version 0.1.1
[phplua.git] / config.m4
blobea150af852e3a9f7e3b6ca72dc0d8601a88a2ff4
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])
6   
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`
11   fi
12   FOUND=0
13   if test -f "$PKG_CONFIG"; then
14     AC_MSG_RESULT(found)
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
18     do
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`"
24         FOUND=1
25         break
26       fi
27     done
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)
31     fi
32   else
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.)
36   fi
37   PHP_NEW_EXTENSION(lua, lua.c, $ext_shared)