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