1 dnl $Id: config.m4,v 1.1 2007/07/12 13:01:37 johannes Exp $
2 dnl config.m4 for extension lua
4 PHP_ARG_WITH(lua, for lua support,
5 [ --with-lua Include lua support])
7 if test "$PHP_LUA" != "no"; then
8 AC_MSG_CHECKING(for pkg-config)
9 if test ! -f "$PKG_CONFIG"; then
10 PKG_CONFIG=`which pkg-config`
13 if test -f "$PKG_CONFIG"; then
15 AC_MSG_CHECKING(for lua via pkg-config)
16 CHECK_PC="lua lua-5.2 lua5.2 lua-5.1 lua5.1 lua-5.0 lua5.0"
17 for PROBE in $CHECK_PC
19 if $PKG_CONFIG --exists $PROBE;then
20 LUAVERSION=`pkg-config --modversion $PROBE`
21 AC_MSG_RESULT(found. version $LUAVERSION)
22 LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs $PROBE`"
23 CFLAGS="$CFLAGS `$PKG_CONFIG --cflags $PROBE`"
28 if test $FOUND != 1; then
29 AC_MSG_RESULT(not found)
30 AC_MSG_ERROR(lua couldn't be found. Check PKG_CONFIG_PATH)
33 AC_MSG_RESULT(not found)
34 AC_MSG_ERROR(In order to compile cairo you will need a working pkg-config
35 Use PKG_CONFIG to specify pkg-config in a non-standard location.)
37 PHP_NEW_EXTENSION(lua, lua.c, $ext_shared)