config.m4 1.8 KB

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