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
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)`"
29 AC_MSG_ERROR([${with_pango_incl} directory doesn't contain pango/pango.h])
34 if test x$windows = xyes; then
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`"
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"}'`
58 if test x"${gnash_pango_version}" = x; then
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}"
70 if test x$gnash_pango_version != x; then
76 if test x"${gnash_pango_version}" = x; then
79 AC_MSG_RESULT([${gnash_pango_version}])
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)`
92 AC_MSG_ERROR([${with_pango_lib} directory doesn't contain libpango.])
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`
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}"
110 ac_cv_path_pango_lib="-lpango-${gnash_pango_version}"
117 AC_MSG_CHECKING([for libpango library])
118 AC_MSG_RESULT(${ac_cv_path_pango_lib})
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}"])
124 if test x"${ac_cv_path_pango_incl}" != x; then
125 PANGO_CFLAGS="${ac_cv_path_pango_incl}"
130 if test x"${ac_cv_path_pango_lib}" != x; then
131 PANGO_LIBS="${ac_cv_path_pango_lib}"
136 AC_SUBST(PANGO_CFLAGS)
143 # indent-tabs-mode: nil