Changed the names to match the PECL nomenclature
[phpCairo.git] / src / cairo / config.m4
blobe1dbe81273e622c598cf08b9dd6076fa161e44cb
1 dnl
2 dnl $ Id: phpCairo 1.0.1$
3 dnl
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
16 #endif
18 [AC_MSG_RESULT(ok)],
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`
32   fi
33   if test -f "$PKG_CONFIG"; then
34         AC_MSG_RESULT(found)
35         AC_MSG_CHECKING(for cairo)
37         if $PKG_CONFIG --exists cairo; then
38           AC_MSG_RESULT(found)
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])
42         else
43           AC_MSG_RESULT(not found)
44           AC_MSG_ERROR(Ooops ! no cairo detected in the system)
45         fi
46   else
47         AC_MSG_RESULT(not found)
48         AC_MSG_ERROR(Ooops ! no pkg-config found .... )
49   fi