xref: /PHP-7.2/ext/pdo/config.m4 (revision 60a69dae)
1dnl $Id$
2dnl config.m4 for extension pdo
3dnl vim:se ts=2 sw=2 et:
4
5AC_DEFUN([PHP_PDO_PEAR_CHECK],[
6  pdo_running_under_pear=0
7  case `pwd` in
8    /var/tmp/pear-build-*)
9      pdo_running_under_pear=1
10      ;;
11  esac
12
13  if test "$pdo_running_under_pear$PHP_PEAR_VERSION" = "1"; then
14    # we're running in an environment that smells like pear,
15    # and the PHP_PEAR_VERSION env var is not set.  That implies
16    # that we're running under a slightly broken pear installer
17    AC_MSG_ERROR([
18PDO requires that you upgrade your PEAR installer tools. Please
19do so now by running:
20
21  % sudo pear upgrade pear
22
23or by manually downloading and installing PEAR version 1.3.5 or higher.
24
25Once you've upgraded, please re-try your PDO install.
26    ])
27  fi
28])
29
30PHP_ARG_ENABLE(pdo, whether to enable PDO support,
31[  --disable-pdo           Disable PHP Data Objects support], yes)
32
33if test "$PHP_PDO" != "no"; then
34
35  dnl Make sure $PHP_PDO is 'yes' when it's not 'no' :)
36  PHP_PDO=yes
37
38  PHP_PDO_PEAR_CHECK
39
40  PHP_NEW_EXTENSION(pdo, pdo.c pdo_dbh.c pdo_stmt.c pdo_sql_parser.c pdo_sqlstate.c, $ext_shared)
41  ifdef([PHP_ADD_EXTENSION_DEP],
42  [
43    PHP_ADD_EXTENSION_DEP(pdo, spl, true)
44  ])
45
46  ifdef([PHP_INSTALL_HEADERS],
47  [
48    dnl Sadly, this is a complete NOP for pecl extensions
49    PHP_INSTALL_HEADERS(ext/pdo, [php_pdo.h php_pdo_driver.h php_pdo_error.h])
50  ])
51
52  dnl so we always include the known-good working hack.
53  PHP_ADD_MAKEFILE_FRAGMENT
54fi
55