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
18 AC_DEFUN([GNASH_PATH_PANGO],
21 dnl Look for the header
22 AC_ARG_WITH(pango_incl, AC_HELP_STRING([--with-pango-incl], [directory where libpango header is]), with_pango_incl=${withval})
23 AC_CACHE_VAL(ac_cv_path_pango_incl,[
24 if test x"${with_pango_incl}" != x ; then
25 if test -f ${with_pango_incl}/pango/pango.h ; then
26 ac_cv_path_pango_incl="-I`(cd ${with_pango_incl}; pwd)`"
28 AC_MSG_ERROR([${with_pango_incl} directory doesn't contain pango/pango.h])
33 if test x$windows = xyes; then
39 if test x$cross_compiling = xno; then
40 if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_pango_incl}" = x; then
41 $PKG_CONFIG --exists $pango_pkg && ac_cv_path_pango_incl="`$PKG_CONFIG --cflags $pango_pkg`"
45 dnl Attempt to find the top level directory, which unfortunately has a
46 dnl version number attached. At least on Debain based systems, this
47 dnl doesn't seem to get a directory that is unversioned.
49 AC_MSG_CHECKING([for the Pango Version])
51 if test x$cross_compiling = xno; then
52 if test x"$PKG_CONFIG" != x; then
53 $PKG_CONFIG --exists $pango_pkg && gnash_pango_version=`$PKG_CONFIG --modversion $pango_pkg | cut -d "." -f 1 | awk '{print $'0'".0"}'`
57 if test x"${gnash_pango_version}" = x; then
59 gnash_pango_version=""
60 for i in $incllist; do
61 for j in `ls -dr $i/pango-[[0-9]].[[0-9]] 2>/dev/null`; do
62 if test -f $j/pango/pango.h; then
63 gnash_pango_topdir=`basename $j`
64 gnash_pango_version=`echo ${gnash_pango_topdir} | sed -e 's:pango-::'`
65 ac_cv_path_pango_incl="-I$i/${gnash_pango_topdir}"
69 if test x$gnash_pango_version != x; then
75 if test x"${gnash_pango_version}" = x; then
78 AC_MSG_RESULT([${gnash_pango_version}])
81 AC_MSG_CHECKING([for libpango header])
82 AC_MSG_RESULT(${ac_cv_path_pango_incl})
84 dnl Look for the library
85 AC_ARG_WITH(pango_lib, AC_HELP_STRING([--with-pango-lib], [directory where pango library is]), with_pango_lib=${withval})
86 AC_CACHE_VAL(ac_cv_path_pango_lib,[
87 if test x"${with_pango_lib}" != x ; then
88 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
89 ac_cv_path_pango_lib=-L`(cd ${with_pango_lib}; pwd)`
91 AC_MSG_ERROR([${with_pango_lib} directory doesn't contain libpango.])
96 if test x$cross_compiling = xno; then
97 if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_pango_lib}" = x; then
98 $PKG_CONFIG --exists $pango_pkg && ac_cv_path_pango_lib=`$PKG_CONFIG --libs-only-l $pango_pkg`
102 if test x"${ac_cv_path_pango_lib}" = x; then
103 for i in $libslist; do
104 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
105 if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
106 ac_cv_path_pango_lib="-L$i -lpango-${gnash_pango_version}"
109 ac_cv_path_pango_lib="-lpango-${gnash_pango_version}"
116 AC_MSG_CHECKING([for libpango library])
117 AC_MSG_RESULT(${ac_cv_path_pango_lib})
119 if test x"${ac_cv_path_pango_lib}" = x; then
120 AC_CHECK_LIB(pango-${gnash_pango_version}, pango_engine_shape_class_init, [ac_cv_path_pango_lib="-lpango-${gnash_pango_version}"])
123 if test x"${ac_cv_path_pango_incl}" != x; then
124 PANGO_CFLAGS="${ac_cv_path_pango_incl}"
129 if test x"${ac_cv_path_pango_lib}" != x; then
130 PANGO_LIBS="${ac_cv_path_pango_lib}"
135 AC_SUBST(PANGO_CFLAGS)
142 # indent-tabs-mode: nil