Mercurial > hg > xemacs-beta
diff configure @ 5739:a2912073be85
Support bignums with MPIR. Add documentation on the bignum, ratio,
and bigfloat implementations. See xemacs-patches message with ID
<CAHCOHQkytZao7Uk9ggeo1HKKJtN1bqO054X2mPsGYyQFjbHrZA@mail.gmail.com>
and following messages.
author | Jerry James <james@xemacs.org> |
---|---|
date | Wed, 19 Jun 2013 09:30:30 -0600 |
parents | 3192994c49ca |
children | 9c17f7be0b92 |
line wrap: on
line diff
--- a/configure Mon Jun 17 20:37:47 2013 +0100 +++ b/configure Wed Jun 19 09:30:30 2013 -0600 @@ -1968,7 +1968,8 @@ loaded libraries (Dynamic Shared Objects). --with-bignum=TYPE Compile in support for bignums, ratios, or bigfloats using library support. TYPE must be one of "gmp" - (for GNU MP), "mp" (for BSD MP), or "no" (disabled). + (for GNU MP), "mpir" (for MPIR), "mp" (for BSD MP), + or "no" (disabled). Platform Specific options ------------------------- @@ -5178,14 +5179,14 @@ enableval="$with_bignum" withval="$with_bignum" _bignum_bogus=yes - for x in no gmp mp ; do + for x in no gmp mpir mp ; do if test $x = $with_bignum ; then _bignum_bogus=no fi done if test "$_bignum_bogus" = "yes" ; then (echo "$progname: Usage error:" -echo " " "The --with-bignum option must have one of these values: \`no',\`gmp',\`mp'." +echo " " "The --with-bignum option must have one of these values: \`no',\`gmp',\`mpir',\`mp'." echo " Use \`$progname --help' to show usage.") >&2 && exit 1 fi unset _bignum_bogus @@ -20779,6 +20780,62 @@ else { echo "Error:" "Required GMP numeric support cannot be provided." >&2; exit 1; } fi +elif test "$with_bignum" = "mpir"; then + ac_fn_c_check_header_mongrel "$LINENO" "mpir.h" "ac_cv_header_mpir_h" "$ac_includes_default" +if test "x$ac_cv_header_mpir_h" = xyes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __gmpz_init in -lmpir" >&5 +$as_echo_n "checking for __gmpz_init in -lmpir... " >&6; } +if ${ac_cv_lib_mpir___gmpz_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmpir $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char __gmpz_init (); +int +main () +{ +return __gmpz_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_mpir___gmpz_init=yes +else + ac_cv_lib_mpir___gmpz_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpir___gmpz_init" >&5 +$as_echo "$ac_cv_lib_mpir___gmpz_init" >&6; } +if test "x$ac_cv_lib_mpir___gmpz_init" = xyes; then : + have_mpz_init=yes +fi + +fi + + + if test "$have_mpz_init" = "yes"; then + $as_echo "#define WITH_NUMBER_TYPES 1" >>confdefs.h + + $as_echo "#define WITH_MPIR 1" >>confdefs.h + + LIBS="-lmpir $LIBS" && if test "$verbose" = "yes"; then echo " Prepending \"-lmpir\" to \$LIBS"; fi + else + { echo "Error:" "Required MPIR numeric support cannot be provided." >&2; exit 1; } + fi elif test "$with_bignum" = "mp"; then for library in "" "-lcrypto"; do ac_fn_c_check_header_mongrel "$LINENO" "mp.h" "ac_cv_header_mp_h" "$ac_includes_default" @@ -21728,6 +21785,7 @@ test "$with_dnet" = yes && echo " Compiling in support for DNET." test "$with_modules" = "yes" && echo " Compiling in support for dynamic shared object modules." test "$with_bignum" = "gmp" && echo " Compiling in support for more number types using the GNU MP library." +test "$with_bignum" = "mpir" && echo " Compiling in support for more number types using the MPIR library." test "$with_bignum" = "mp" && echo " Compiling in support for more number types using the BSD MP library." if test "$with_union_type" = yes ; then echo " Using the union type for Lisp_Objects."