From: Lubomir Sedlacik Date: Sat, 9 Nov 2002 17:00:27 +0000 (+0000) Subject: fix --with-gmp to correctly handle situation when $withval=yes X-Git-Tag: silc.server.0.9.6~67 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=72557993ed3b5b8fbf6b3af83a02e793fa0c5ab3 fix --with-gmp to correctly handle situation when $withval=yes --- diff --git a/configure.in.pre b/configure.in.pre index 2766a7ce..1dee7247 100644 --- a/configure.in.pre +++ b/configure.in.pre @@ -554,6 +554,8 @@ fi # source tree. # mp_gmp=false +SAVELIBS="$LIBS" +SAVECFLAGS="$CFLAGS" AC_MSG_CHECKING(whether to search for GMP) AC_ARG_WITH(gmp, [[ --with-gmp[=DIR] use GMP instead of MPI [search in DIR/lib and DIR/include]]], @@ -562,6 +564,10 @@ AC_ARG_WITH(gmp, no) AC_MSG_RESULT(no) ;; + yes) + AC_MSG_RESULT(yes) + LIBS="-lgmp $LIBS" + ;; *) AC_MSG_RESULT(yes) @@ -577,14 +583,19 @@ AC_ARG_WITH(gmp, fi LIBS="$withval $LIBS" - AC_CHECK_LIB(gmp, __gmpz_init, - [ - mp_gmp=true - AC_DEFINE(SILC_MP_GMP) - AC_MSG_RESULT(Using GMP as a MP library.) - ]) ;; esac + + AC_CHECK_LIB(gmp, __gmpz_init, + [ + mp_gmp=true + AC_DEFINE(SILC_MP_GMP) + AC_MSG_RESULT(Using GMP as a MP library.) + ], + [ + LIBS="$SAVELIBS" + CFLAGS="$SAVECFLAGS" + ]) ], AC_MSG_RESULT(no) )