1
dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
dnl pandora-build: A pedantic build system
5
dnl Copyright (C) 2009 Sun Microsystems, Inc.
6
dnl This file is free software; the Free Software Foundation
7
dnl gives unlimited permission to copy and/or distribute it,
8
dnl with or without modifications, as long as this notice is preserved.
13
AC_DEFUN([PANDORA_WITH_PHP],[
16
[AS_HELP_STRING([--with-php],
17
[Build NDB/PHP @<:@default=no@:>@])],
21
AS_IF([test "x$with_php" != "xno"],[
22
dnl We explicitly requested PHP build. Fail on too-young SWIG.
23
AS_IF([test "x$SWIG_CAN_BUILD_PHP" != "xyes"],
24
[AC_MSG_ERROR("Your version of SWIG is too young to build NDB/PHP. >=1.3.33 is required!")])
25
AS_IF([test "x$with_php" != "xyes"],
26
[ac_check_php_config=$with_php],
27
[ac_check_php_config="php-config php-config5"])
28
AC_CHECK_PROGS(PHP_CONFIG, [$ac_check_php_config])
31
AS_IF([test "x$PHP_CONFIG" != "x"],[
32
PHP_CFLAGS=`$PHP_CONFIG --includes`
33
PHP_CPPFLAGS=`$PHP_CONFIG --includes`
34
PHP_LDFLAGS=`$PHP_CONFIG --ldflags`
35
PHP_EXTDIR=`$PHP_CONFIG --extension-dir`
36
strip_php_prefix=`$PHP_CONFIG --prefix | sed 's/\//./g'`
37
PHP_ARCH_DIR=`echo $PHP_EXTDIR | sed "s/$strip_php_prefix//"`
48
AC_SUBST(PHP_CPPFLAGS)
51
AC_SUBST(PHP_ARCH_DIR)
53
AM_CONDITIONAL(BUILD_PHP, test "$with_php" = "yes")