# Autoconf check to look for Cairo Graphics Library. # # Usage: # AC_CAIRO(min-version, action-if-found, action-if-not-found) # All parameters are optional. If an appropriate version of Cairo is found, # $CAIRO_LIBS and $CAIRO_CFLAGS will be set and substituted. # Version 1 # by Jason Dorje Short # Distributed under the same licence as Cairo. AC_DEFUN([AC_CAIRO], [ if test "$1" != ""; then cairo_version_check_string=" ($1 or higher)" else cairo_version_check_string="" fi AC_PATH_PROG(PKG_CONFIG, pkg-config, no) AC_CACHE_CHECK([for Cairo graphics library$cairo_version_check_string], [ac_cv_cairo_graphics], [ if test "$PKG_CONFIG" = "no"; then AC_MSG_WARN([pkg-config is missing.]) ac_cv_cairo_graphics=no else if test "$1" != ""; then if $PKG_CONFIG --atleast-version $1 cairo; then ac_cv_cairo_graphics=yes else ac_cv_cairo_graphics=no fi fi fi ]) if test "$ac_cv_cairo_graphics" = "yes"; then CAIRO_LIBS=`$PKG_CONFIG --libs cairo` AC_SUBST($CAIRO_LIBS) CAIRO_CFLAGS=`$PKG_CONFIG --cflags cairo` AC_SUBST($CAIRO_CFLAGS) $2 else CAIRO_LIBS="" CAIRO_CFLAGS="" $3 fi ])