From: Pekka Riikonen Date: Sun, 22 Jul 2001 19:19:09 +0000 (+0000) Subject: updates. X-Git-Tag: robodoc-323~48 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=4d0fdd0cbc3c389068e7ab4bd9ceb6d6dc98dc1d updates. --- diff --git a/CHANGES b/CHANGES index 659d8d62..e4cc027b 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,9 @@ Sun Jul 22 19:40:30 EEST 2001 Pekka Riikonen a bit differently than it used to. Made the change to the SKE protocol specification. + * Added better GMP detection to configure.in.pre. A patch + by salo. + Fri Jul 20 13:16:00 EEST 2001 Pekka Riikonen * Fixed a minor bug in SKE that might cause some problem on diff --git a/apps/irssi/src/silc/core/silc-core.c b/apps/irssi/src/silc/core/silc-core.c index da42b3b3..9ea0cfdc 100644 --- a/apps/irssi/src/silc/core/silc-core.c +++ b/apps/irssi/src/silc/core/silc-core.c @@ -257,7 +257,7 @@ void silc_core_init_finish(void) if (opt_version) { printf("SILC Secure Internet Live Conferencing, version %s\n", silc_version); - printf("(c) 1997 - 2001 Pekka Riikonen \n"); + printf("(c) 1997 - 2001 Pekka Riikonen \n"); exit(0); } diff --git a/apps/silcd/silcd.c b/apps/silcd/silcd.c index 12763c0f..6a8b62b4 100644 --- a/apps/silcd/silcd.c +++ b/apps/silcd/silcd.c @@ -2,7 +2,7 @@ silcd.c - Author: Pekka Riikonen + Author: Pekka Riikonen Copyright (C) 1997 - 2001 Pekka Riikonen @@ -119,7 +119,7 @@ int main(int argc, char **argv) "version %s (base: SILC Toolkit %s)\n", silc_dist_version, silc_version); printf("(c) 1997 - 2001 Pekka Riikonen " - "\n"); + "\n"); exit(0); break; case 'd': diff --git a/configure.in.pre b/configure.in.pre index 0ea3f116..b0e5a1b6 100644 --- a/configure.in.pre +++ b/configure.in.pre @@ -506,18 +506,45 @@ if test "x$socks" = "x5"; then fi # -# MP library checking. First check whether system has GMP. If it has that -# then use it. If not then compile the MPI library in the source tree. +# MP library checking. First check whether user wants to use GMP and use +# it if found. If not or not defined then compile the MPI library in the +# source tree. # -mp_gmp=false -AC_CHECK_HEADER(gmp.h, - AC_CHECK_LIB(gmp, __gmpz_init, - mp_gmp=true - AC_DEFINE(SILC_MP_GMP) - LIBS="$LIBS -L/usr/lib -L/usr/local/lib -lgmp" - AC_MSG_RESULT(Using GMP as MP library) - ) +AC_MSG_CHECKING(whether to support GMP) +AC_ARG_WITH(gmp, +[ --with-gmp[=PATH] Compile with GMP support instead of MPI], +[ case "$withval" in + no) + AC_MSG_RESULT(no) + mp_gmp=false + ;; + *) + AC_MSG_RESULT(yes) + + if test -d "$withval/include"; then + CFLAGS="$CFLAGS -I$withval/include" + else + CFLAGS="$CFLAGS -I$withval" + fi + if test -d "$withval/lib"; then + withval="-L$withval/lib -lgmp" + else + withval="-L$withval -lgmp" + fi + + LIBS="$withval $LIBS" + mp_gmp=false + AC_CHECK_LIB(gmp, __gmpz_init, + mp_gmp=true + AC_DEFINE(SILC_MP_GMP) + AC_MSG_RESULT(Using GMP as MP library) + ) + ;; + esac ], + AC_MSG_RESULT(no) + mp_gmp=false ) + AM_CONDITIONAL(SILC_MP_GMP, test x$mp_gmp = xtrue) if test x$mp_gmp = xfalse; then AM_CONDITIONAL(SILC_MP_NSS_MPI, test x$mp_gmp = xfalse) diff --git a/lib/silcmath/mp_mpi.c b/lib/silcmath/mp_mpi.c index 09f1ae97..98ba8aeb 100644 --- a/lib/silcmath/mp_mpi.c +++ b/lib/silcmath/mp_mpi.c @@ -40,13 +40,11 @@ size_t silc_mp_size(SilcMPInt *mp) size_t silc_mp_sizeinbase(SilcMPInt *mp, int base) { - return mp_radix_size(mp, base) - 2; /* XXX this is wrong but it looks like - the MPI always returns the correct - value plus one as opposed what the - GMP does, it returns always one less, - and SILC code expects that. Bad thing - is that the condition "returns always - correct value" cannot be trusted! */ + return mp_radix_size(mp, base) - 2; /* XXX This is actually wrong since + this might produce wrong balue. + But, it looks like MPI always returns + correct value plus one, whereas + GMP returns always the right value. */ } void silc_mp_set(SilcMPInt *dst, SilcMPInt *src)