1
dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
5
dnl Copyright (C) 2008 MySQL
7
dnl This program is free software; you can redistribute it and/or modify
8
dnl it under the terms of the GNU General Public License as published by
9
dnl the Free Software Foundation; either version 2 of the License, or
10
dnl (at your option) any later version.
12
dnl This program is distributed in the hope that it will be useful,
13
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
dnl GNU General Public License for more details.
17
dnl You should have received a copy of the GNU General Public License
18
dnl along with this program; if not, write to the Free Software
19
dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
[AS_HELP_STRING([--with-php],
26
[Build NDB/PHP @<:@default=no@:>@])],
30
AS_IF([test "x$with_php" != "xno"],[
31
dnl We explicitly requested PHP build. Fail on too-young SWIG.
32
AS_IF([test "x$SWIG_CAN_BUILD_PHP" != "xyes"],
33
[AC_MSG_ERROR("Your version of SWIG is too young to build NDB/PHP. >=1.3.33 is required!")])
34
AS_IF([test "x$with_php" != "xyes"],
35
[ac_check_php_config=$with_php],
36
[ac_check_php_config="php-config php-config5"])
37
AC_CHECK_PROGS(PHP_CONFIG, [$ac_check_php_config])
40
AS_IF([test "x$PHP_CONFIG" != "x"],[
41
PHP_CFLAGS=`$PHP_CONFIG --includes`
42
PHP_CPPFLAGS=`$PHP_CONFIG --includes`
43
PHP_LDFLAGS=`$PHP_CONFIG --ldflags`
44
PHP_EXTDIR=`$PHP_CONFIG --extension-dir`
45
strip_php_prefix=`$PHP_CONFIG --prefix | sed 's/\//./g'`
46
PHP_ARCH_DIR=`echo $PHP_EXTDIR | sed "s/$strip_php_prefix//"`
57
AC_SUBST(PHP_CPPFLAGS)
60
AC_SUBST(PHP_ARCH_DIR)