2 dnl $ Id: phpCairo 1.0.1$
5 PHP_ARG_ENABLE(cairo, whether to enable phpCairo functions,
6 [ --enable-cairo Enable phpCairo support])
8 if test "$PHP_CAIRO" != "no"; then
9 export OLD_CPPFLAGS="$CPPFLAGS"
10 export CPPFLAGS="$CPPFLAGS $INCLUDES -DHAVE_CAIRO"
12 AC_MSG_CHECKING(PHP version)
13 AC_TRY_COMPILE([#include <php_version.h>], [
14 #if PHP_VERSION_ID < 50000
15 #error this extension requires at least PHP version 5.0.0
19 [AC_MSG_ERROR([need at least PHP 5.0.0])])
21 export CPPFLAGS="$OLD_CPPFLAGS"
24 PHP_SUBST(PHPCAIRO_SHARED_LIBADD)
25 AC_DEFINE(HAVE_PHPCAIRO, 1, [ ])
27 PHP_NEW_EXTENSION(cairo, Cairo.c , $ext_shared)
29 AC_MSG_CHECKING(for pkg-config)
30 if test ! -f "$PKG_CONFIG"; then
31 PKG_CONFIG=`which pkg-config`
33 if test -f "$PKG_CONFIG"; then
35 AC_MSG_CHECKING(for cairo)
37 if $PKG_CONFIG --exists cairo; then
39 LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs cairo`"
40 CFLAGS="$CFLAGS `$PKG_CONFIG --cflags cairo`"
41 AC_DEFINE(HAVE_CAIRO, 1, [whther cairo exists in the system])
43 AC_MSG_RESULT(not found)
44 AC_MSG_ERROR(Ooops ! no cairo detected in the system)
47 AC_MSG_RESULT(not found)
48 AC_MSG_ERROR(Ooops ! no pkg-config found .... )