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 dnl agg_rasterizer_compound_aa.h is a new file included in AGG 2.4,
19 dnl but not in AGG 2.3. As we need AGG 2.4, we use this as
20 AC_DEFUN([GNASH_PATH_AGG],
22 dnl Lool for the header
23 AC_ARG_WITH(agg_incl, AC_HELP_STRING([--with-agg-incl], [directory where AGG headers are]), with_agg_incl=${withval})
24 AC_MSG_CHECKING([for AGG headers])
25 AC_CACHE_VAL(ac_cv_path_agg_incl, [
26 if test x"${with_agg_incl}" != x ; then
27 if test -f ${with_agg_incl}/agg_rasterizer_compound_aa.h ; then
28 agg_include_dir="`(cd ${with_agg_incl}; pwd)`"
29 ac_cv_path_agg_incl="-I${agg_include_dir}"
32 AC_MSG_ERROR([${with_agg_incl} directory doesn't contain any headers])
38 if test x$cross_compiling = xno; then
39 if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_agg_incl}" = x; then
40 if $PKG_CONFIG --exists libagg ; then
41 ac_cv_path_agg_incl="`$PKG_CONFIG --cflags libagg`"
42 $PKG_CONFIG --atleast-version 2.5.0 libagg && agg25=yes
44 dnl I think this setting of agg_include_dir is too error prone!
45 agg_include_dir="`$PKG_CONFIG --cflags-only-I libagg | cut -d ' ' -f 1 | sed -e 's/-I//g'`"
46 if test -f $agg_include_dir/agg_gradient_lut.h ; then
53 if test x"${ac_cv_path_agg_incl}" = x; then
54 for i in $incllist; do
55 if test -f $i/agg2/agg_gradient_lut.h; then
56 ac_cv_path_agg_incl="-I$i/agg2"
57 agg_include_dir="$i/agg2"
61 dnl Haiku uses only agg as the directory, not agg2
62 if test -f $i/agg/agg_gradient_lut.h; then
63 ac_cv_path_agg_incl="-I$i/agg"
64 agg_include_dir="$i/agg"
71 AC_MSG_RESULT(${ac_cv_path_agg_incl})
73 if test x"${ac_cv_path_agg_incl}" != x ; then
74 AGG_CFLAGS="${ac_cv_path_agg_incl}"
80 dnl Look for the library
81 AC_ARG_WITH(agg_lib, AC_HELP_STRING([--with-agg-lib], [directory where AGG libraries are]), with_agg_lib=${withval})
82 AC_CACHE_VAL(ac_cv_path_agg_lib,[
83 if test x"${with_agg_lib}" != x ; then
84 if test -f ${with_agg_lib}/libagg.a -o -f ${with_agg_lib}/libagg.${shlibext}; then
85 ac_cv_path_agg_lib="-L`(cd ${with_agg_lib}; pwd)`"
87 AC_MSG_ERROR([${with_agg_lib} directory doesn't contain AGG libraries.])
93 if test x$cross_compiling = xno; then
94 if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_agg_lib}" = x; then
95 $PKG_CONFIG --exists libagg && ac_cv_path_agg_lib="`$PKG_CONFIG --libs libagg`"
96 $PKG_CONFIG --exists libagg && pkg=yes
101 if test x"${ac_cv_path_agg_lib}" = x; then
102 for i in $libslist; do
103 if test -f $i/libagg.a -o -f $i/libagg.${shlibext}; then
104 if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
105 ac_cv_path_agg_lib="-L$i"
108 ac_cv_path_agg_lib=""
115 if test x"${ac_cv_path_agg_lib}" = x; then
116 AC_CHECK_LIB(agg, agg::gamma_ctrl_impl::calc_points, [ac_cv_path_agg_lib=""])
118 AC_MSG_CHECKING([for libagg library])
119 AC_MSG_RESULT(${ac_cv_path_agg_lib})
122 if test x"${ac_cv_path_agg_lib}" != x -a x"$pkg" = x"yes"; then
123 AGG_LIBS="${ac_cv_path_agg_lib}"
125 if test x"$agg25" = x"yes"; then
126 AGG_LIBS="${ac_cv_path_agg_lib} -lagg"
132 dnl AC_EGREP_HEADER(render_scanlines_compound_layered,
133 dnl ${agg_include_dir}/agg_renderer_scanline.h,
134 dnl [ agg_need_compatibility_layer="no" ],
135 dnl [ agg_need_compatibility_layer="yes" ] )
137 dnl AC_SUBST(agg_need_compatibility_layer)
139 dnl if test x"${agg_need_compatibility_layer}" = xyes; then
140 dnl AC_DEFINE(HAVE_AGG_SCANLINES_COMPOUND_LAYERED, [0], [AGG headers include the render_scanlines_compound_layered templated function])
142 dnl AC_DEFINE(HAVE_AGG_SCANLINES_COMPOUND_LAYERED, [1], [AGG headers include the render_scanlines_compound_layered templated function])
151 # indent-tabs-mode: nil