Add automated test on delayed return value handling in ExternalInterface.call().
[gnash.git] / macros / pango.m4
blob96f0457e2391b1dc084a777de2b9969103df31a3
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
19 AC_DEFUN([GNASH_PATH_PANGO],
22   dnl Look for the header
23   AC_ARG_WITH(pango_incl, AC_HELP_STRING([--with-pango-incl], [directory where libpango header is]), with_pango_incl=${withval})
24   AC_CACHE_VAL(ac_cv_path_pango_incl,[
25     if test x"${with_pango_incl}" != x ; then
26       if test -f ${with_pango_incl}/pango/pango.h ; then
27         ac_cv_path_pango_incl="-I`(cd ${with_pango_incl}; pwd)`"
28       else
29         AC_MSG_ERROR([${with_pango_incl} directory doesn't contain pango/pango.h])
30       fi
31     fi
32   ])
34   if test x$windows = xyes; then
35     pango_pkg=pangowin32
36   else
37     pango_pkg=pangox
38   fi
40   if test x$cross_compiling = xno; then
41     if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_pango_incl}" = x; then
42       $PKG_CONFIG --exists $pango_pkg && ac_cv_path_pango_incl="`$PKG_CONFIG --cflags $pango_pkg`"
43     fi
44   fi
46   dnl Attempt to find the top level directory, which unfortunately has a
47   dnl version number attached. At least on Debain based systems, this
48   dnl doesn't seem to get a directory that is unversioned.
50   AC_MSG_CHECKING([for the Pango Version])
52   if test x$cross_compiling = xno; then
53     if test x"$PKG_CONFIG" != x; then
54       $PKG_CONFIG --exists $pango_pkg && gnash_pango_version=`$PKG_CONFIG --modversion $pango_pkg | cut -d "." -f 1 | awk '{print $'0'".0"}'`
55     fi
56   fi
58   if test x"${gnash_pango_version}" = x; then
59     gnash_pango_topdir=""
60     gnash_pango_version=""
61     for i in $incllist; do
62       for j in `ls -dr $i/pango-[[0-9]].[[0-9]] 2>/dev/null`; do
63         if test -f $j/pango/pango.h; then
64           gnash_pango_topdir=`basename $j`
65           gnash_pango_version=`echo ${gnash_pango_topdir} | sed -e 's:pango-::'`
66           ac_cv_path_pango_incl="-I$i/${gnash_pango_topdir}"
67           break
68         fi
69       done
70         if test x$gnash_pango_version != x; then
71           break;
72         fi
73     done
74   fi      
76   if test x"${gnash_pango_version}" = x; then
77     AC_MSG_RESULT(none)
78   else
79     AC_MSG_RESULT([${gnash_pango_version}])
80   fi
81   
82   AC_MSG_CHECKING([for libpango header])
83   AC_MSG_RESULT(${ac_cv_path_pango_incl}) 
85   dnl Look for the library
86   AC_ARG_WITH(pango_lib, AC_HELP_STRING([--with-pango-lib], [directory where pango library is]), with_pango_lib=${withval})
87   AC_CACHE_VAL(ac_cv_path_pango_lib,[
88     if test x"${with_pango_lib}" != x ; then
89       if test -f ${with_pango_lib}/libpangox-${gnash_pango_version}.a -o -f ${with_pango_lib}/libpangox-${gnash_pango_version}.${shlibext} -o -f ${with_pango_lib}/libpangox-${gnash_pango_version}.${shlibext}.a; then
90         ac_cv_path_pango_lib=-L`(cd ${with_pango_lib}; pwd)`
91       else
92         AC_MSG_ERROR([${with_pango_lib} directory doesn't contain libpango.])
93       fi
94     fi
95   ])
96   
97   if test x$cross_compiling = xno; then
98     if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_pango_lib}" = x; then
99       $PKG_CONFIG --exists $pango_pkg && ac_cv_path_pango_lib=`$PKG_CONFIG --libs-only-l $pango_pkg`
100     fi
101   fi
103   if test x"${ac_cv_path_pango_lib}" = x; then
104     for i in $libslist; do
105       if test -f $i/libpango-${gnash_pango_version}.a -o -f $i/libpango-${gnash_pango_version}.${shlibext} -o -f $i/libpango-${gnash_pango_version}.${shlibext}.a; then
106         if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
107           ac_cv_path_pango_lib="-L$i -lpango-${gnash_pango_version}"
108           break
109         else
110           ac_cv_path_pango_lib="-lpango-${gnash_pango_version}"
111           break
112         fi
113       fi
114     done
115   fi
116         
117   AC_MSG_CHECKING([for libpango library])
118   AC_MSG_RESULT(${ac_cv_path_pango_lib})
119   
120   if test x"${ac_cv_path_pango_lib}" = x; then
121     AC_CHECK_LIB(pango-${gnash_pango_version}, pango_engine_shape_class_init, [ac_cv_path_pango_lib="-lpango-${gnash_pango_version}"])
122   fi
124   if test x"${ac_cv_path_pango_incl}" != x; then
125     PANGO_CFLAGS="${ac_cv_path_pango_incl}"
126   else
127     PANGO_CFLAGS=""
128   fi
130   if test x"${ac_cv_path_pango_lib}" != x; then
131     PANGO_LIBS="${ac_cv_path_pango_lib}"
132   else
133     PANGO_LIBS=""
134   fi
136   AC_SUBST(PANGO_CFLAGS)
137   AC_SUBST(PANGO_LIBS)
140 # Local Variables:
141 # c-basic-offset: 2
142 # tab-width: 2
143 # indent-tabs-mode: nil
144 # End: