config.m4 822 B

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