From 72557993ed3b5b8fbf6b3af83a02e793fa0c5ab3 Mon Sep 17 00:00:00 2001 From: Lubomir Sedlacik Date: Sat, 9 Nov 2002 17:00:27 +0000 Subject: [PATCH] fix --with-gmp to correctly handle situation when $withval=yes --- configure.in.pre | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) 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) ) -- 2.24.0