Changed the names to match the PECL nomenclature
[phpCairo.git] / individual_files / config.m4
blobd39bc1b9adb82ba20bc99d1fb7153790dd63ed1b
1 dnl
2 dnl $ Id: $
3 dnl
5 PHP_ARG_ENABLE(phpCairo, whether to enable phpCairo functions,
6 [  --enable-phpCairo         Enable phpCairo support])
8 if test "$PHP_PHPCAIRO" != "no"; then
9   export OLD_CPPFLAGS="$CPPFLAGS"
10   export CPPFLAGS="$CPPFLAGS $INCLUDES -DHAVE_PHPCAIRO"
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(phpCairo, phpCairo.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