config.m4 945 B

1234567891011121314151617181920212223242526272829303132333435
  1. PHP_ARG_WITH([gmp],
  2. [for GNU MP support],
  3. [AS_HELP_STRING([[--with-gmp[=DIR]]],
  4. [Include GNU MP support])])
  5. if test "$PHP_GMP" != "no"; then
  6. if test "$PHP_GMP" = "yes"; then
  7. PHP_CHECK_LIBRARY(gmp, __gmpz_rootrem,
  8. [],[
  9. AC_MSG_ERROR([GNU MP Library version 4.2 or greater required.])
  10. ])
  11. PHP_ADD_LIBRARY(gmp,,GMP_SHARED_LIBADD)
  12. else
  13. if test ! -f $PHP_GMP/include/gmp.h; then
  14. AC_MSG_ERROR(Unable to locate gmp.h)
  15. fi
  16. PHP_CHECK_LIBRARY(gmp, __gmpz_rootrem,
  17. [],[
  18. AC_MSG_ERROR([GNU MP Library version 4.2 or greater required.])
  19. ],[
  20. -L$PHP_GMP/$PHP_LIBDIR
  21. ])
  22. PHP_ADD_LIBRARY_WITH_PATH(gmp, $PHP_GMP/$PHP_LIBDIR, GMP_SHARED_LIBADD)
  23. PHP_ADD_INCLUDE($PHP_GMP/include)
  24. fi
  25. PHP_INSTALL_HEADERS([ext/gmp/php_gmp_int.h])
  26. PHP_NEW_EXTENSION(gmp, gmp.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
  27. PHP_SUBST(GMP_SHARED_LIBADD)
  28. AC_DEFINE(HAVE_GMP, 1, [ ])
  29. fi