updates.
authorPekka Riikonen <priikone@silcnet.org>
Sun, 22 Jul 2001 19:19:09 +0000 (19:19 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sun, 22 Jul 2001 19:19:09 +0000 (19:19 +0000)
CHANGES
apps/irssi/src/silc/core/silc-core.c
apps/silcd/silcd.c
configure.in.pre
lib/silcmath/mp_mpi.c

diff --git a/CHANGES b/CHANGES
index 659d8d62e688ff50257ec7043d48feffa942562f..e4cc027b63373b8ee0b7472b8d2d5cccaf79b1cf 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,9 @@ Sun Jul 22 19:40:30 EEST 2001  Pekka Riikonen <priikone@silcnet.org>
          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 <priikone@silcnet.org>
 
        * Fixed a minor bug in SKE that might cause some problem on
index da42b3b3135b3b59d9407716ca42e02bf1e43901..9ea0cfdc844812501c59131118e5f5589195dba7 100644 (file)
@@ -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 <priikone@poseidon.pspt.fi>\n");
+    printf("(c) 1997 - 2001 Pekka Riikonen <priikone@silcnet.org>\n");
     exit(0); 
   }
 
index 12763c0f00eb31f0fca75541033546ec3de3c4de..6a8b62b4bdba6e7fddf6c9e56a052119f2651a25 100644 (file)
@@ -2,7 +2,7 @@
 
   silcd.c
   
-  Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
+  Author: Pekka Riikonen <priikone@silcnet.org>
 
   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 "
-                "<priikone@poseidon.pspt.fi>\n");
+                "<priikone@silcnet.org>\n");
          exit(0);
          break;
        case 'd':
index 0ea3f116345e942b74c551578e06c7db9dfa884a..b0e5a1b6918712a7fd484ecbb08d824f3cbeb81c 100644 (file)
@@ -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)
index 09f1ae9711f7644147fd3679bbd0c014c2b18d1c..98ba8aeb221ef57375c2297562b3be94eeaeaa0c 100644 (file)
@@ -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)