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
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);
}
silcd.c
- Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
+ Author: Pekka Riikonen <priikone@silcnet.org>
Copyright (C) 1997 - 2001 Pekka Riikonen
"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':
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)
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)