config.m4 874 B

12345678910111213141516171819202122232425262728293031
  1. PHP_ARG_WITH(gmp, for GNU MP support,
  2. [ --with-gmp[=DIR] Include GNU MP support])
  3. if test "$PHP_GMP" != "no"; then
  4. MACHINE_INCLUDES=$($CC -dumpmachine)
  5. for i in $PHP_GMP /usr/local /usr; do
  6. test -f $i/include/gmp.h && GMP_DIR=$i && break
  7. test -f $i/include/$MACHINE_INCLUDES/gmp.h && GMP_DIR=$i && break
  8. done
  9. if test -z "$GMP_DIR"; then
  10. AC_MSG_ERROR(Unable to locate gmp.h)
  11. fi
  12. PHP_CHECK_LIBRARY(gmp, __gmpz_rootrem,
  13. [],[
  14. AC_MSG_ERROR([GNU MP Library version 4.2 or greater required.])
  15. ],[
  16. -L$GMP_DIR/$PHP_LIBDIR
  17. ])
  18. PHP_ADD_LIBRARY_WITH_PATH(gmp, $GMP_DIR/$PHP_LIBDIR, GMP_SHARED_LIBADD)
  19. PHP_ADD_INCLUDE($GMP_DIR/include)
  20. PHP_INSTALL_HEADERS([ext/gmp/php_gmp_int.h])
  21. PHP_NEW_EXTENSION(gmp, gmp.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
  22. PHP_SUBST(GMP_SHARED_LIBADD)
  23. AC_DEFINE(HAVE_GMP, 1, [ ])
  24. fi