config.m4 1.4 KB

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