Stop `configure` and throw an error when `--with-mpc`,
`--with-mpc-include` or `--with-mpc-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_log), throwing an error might prevent build-time issues.

ChangeLog:

        * configure.ac: Validate the value passed for `--with-mpc`,
        `--with-mpc-include` and `--with-mpc-lib` do detect 'yes' (no
        argument)

        * 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 b81297050f8..7b715db03e7 100755
--- a/configure
+++ b/configure
@@ -9079,6 +9079,11 @@ if test "${with_mpc_lib+set}" = set; then :
 fi
 
 
+case "|x$with_mpc|x$with_mpc_include|x$with_mpc_lib|" in
+  *"|xyes|"*)
+    as_fn_error $? "--with-mpc{,-include,-lib} require a PATH" "$LINENO" 5
+  ;;
+esac
 if test "x$with_mpc" != x; then
   gmplibs="-L$with_mpc/lib $gmplibs"
   gmpinc="-I$with_mpc/include $gmpinc"
diff --git a/configure.ac b/configure.ac
index 46f8cbc89ff..015cf150101 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1686,6 +1686,11 @@ AC_ARG_WITH(mpc-lib,
 [AS_HELP_STRING([--with-mpc-lib=PATH],
                [specify directory for the installed MPC library])])
 
+case "|x$with_mpc|x$with_mpc_include|x$with_mpc_lib|" in
+  *"|xyes|"*)
+    AC_MSG_ERROR([--with-mpc{,-include,-lib} require a PATH])
+  ;;
+esac
 if test "x$with_mpc" != x; then
   gmplibs="-L$with_mpc/lib $gmplibs"
   gmpinc="-I$with_mpc/include $gmpinc"
-- 
2.54.0

Reply via email to