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