~gearman-developers/gearman-interface/gearman-interface

« back to all changes in this revision

Viewing changes to m4/with_php.m4

  • Committer: Monty Taylor
  • Date: 2009-07-21 20:41:39 UTC
  • Revision ID: mordred@inaugust.com-20090721204139-rcyse999id1lbu1h
Python worker initial import.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
2
dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
 
3
dnl   
 
4
dnl ndb-bindings
 
5
dnl Copyright (C) 2008 MySQL
 
6
dnl 
 
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.
 
11
dnl 
 
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.
 
16
dnl 
 
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
 
20
 
 
21
 
 
22
AC_DEFUN([WITH_PHP],[
 
23
 
 
24
  AC_ARG_WITH([php],
 
25
    [AS_HELP_STRING([--with-php],
 
26
      [Build NDB/PHP @<:@default=no@:>@])],
 
27
    [with_php=$withval],
 
28
    [with_php=no])
 
29
 
 
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])
 
38
    ])
 
39
 
 
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//"`
 
47
  ],[
 
48
    PHP_CFLAGS=
 
49
    PHP_CPPFLAGS=
 
50
    PHP_LDFLAGS=
 
51
    PHP_EXTDIR=
 
52
    PHP_ARCH_DIR=
 
53
    with_php=no
 
54
  ])
 
55
 
 
56
  AC_SUBST(PHP_CFLAGS)
 
57
  AC_SUBST(PHP_CPPFLAGS)
 
58
  AC_SUBST(PHP_LDFLAGS)
 
59
  AC_SUBST(PHP_EXTDIR)
 
60
  AC_SUBST(PHP_ARCH_DIR)
 
61
])
 
62