Stop `configure` and throw an error when `--with-mpfr`,
`--with-mpfr-include` or `--with-mpfr-lib` is passed without an
argument.

If someone by mistake passes any of those options using the option only
or sepparated by a space instead of `=` it currently tries to build it.

Since this syntax is valid in several programs (i.e. those built using
getopt_long), throwing an error might prevent build-time issues.

ChangeLog:

        * configure.ac: Validate the value passed for `--with-mpfr`,
        `--with-mpfr-include` and `--with-mpfr-lib` to detect 'yes'
        (no arguent)

        * configure: Regenerate `configure` with `autoreconf-2.69`.

Signed-off-by: Agatha Isabelle Moreira <[email protected]>
---
 configure    | 5 +++++
 configure.ac | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/configure b/configure
index 7b715db03e7..2c977bd7b9e 100755
--- a/configure
+++ b/configure
@@ -9125,6 +9125,11 @@ if test "${with_mpfr_lib+set}" = set; then :
 fi
 
 
+case "|x$with_mpfr|x$with_mpfr_include|x$with_mpfr_lib|" in
+  *"|xyes|"*)
+    as_fn_error $? "--with-mpfr{,-include,-lib} requires a PATH argument" 
"$LINENO" 5
+  ;;
+esac
 if test "x$with_mpfr" != x; then
   gmplibs="-L$with_mpfr/lib $gmplibs"
   gmpinc="-I$with_mpfr/include $gmpinc"
diff --git a/configure.ac b/configure.ac
index 015cf150101..4997e2d6f5f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1725,6 +1725,11 @@ AC_ARG_WITH(mpfr-lib,
 [AS_HELP_STRING([--with-mpfr-lib=PATH],
                [specify directory for the installed MPFR library])])
 
+case "|x$with_mpfr|x$with_mpfr_include|x$with_mpfr_lib|" in
+  *"|xyes|"*)
+    AC_MSG_ERROR([--with-mpfr{,-include,-lib} requires a PATH argument])
+  ;;
+esac
 if test "x$with_mpfr" != x; then
   gmplibs="-L$with_mpfr/lib $gmplibs"
   gmpinc="-I$with_mpfr/include $gmpinc"
-- 
2.54.0

Reply via email to