configure: Only enable iconv if curses is enabled

Message ID 20190517211805.31918-1-kumar.gala@linaro.org
State New
Headers show
Series
  • configure: Only enable iconv if curses is enabled
Related show

Commit Message

Kumar Gala May 17, 2019, 9:18 p.m.
iconv is only used with if curses is enabled, there's no need to do any
configure checking for iconv, if curses is disabled.  Also, ignore
--enable-iconv if curses is already disabled.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>

---
 configure | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

-- 
2.20.1

Comments

Gerd Hoffmann May 24, 2019, 7:07 a.m. | #1
On Fri, May 17, 2019 at 04:18:05PM -0500, Kumar Gala wrote:
> iconv is only used with if curses is enabled, there's no need to do any

> configure checking for iconv, if curses is disabled.  Also, ignore

> --enable-iconv if curses is already disabled.


How about just doing this ...

--- a/configure
+++ b/configure
@@ -3551,6 +3551,7 @@ EOF
       feature_not_found "curses" "Install ncurses devel"
     fi
     curses=no
+    iconv=no  # curses is the only user
   fi
 fi

... instead?

Patch

diff --git a/configure b/configure
index d2fc346302..a1b60fa977 100755
--- a/configure
+++ b/configure
@@ -1235,13 +1235,18 @@  for opt do
   ;;
   --disable-stack-protector) stack_protector="no"
   ;;
-  --disable-curses) curses="no"
+  --disable-curses)
+      curses="no"
+      iconv="no"
   ;;
   --enable-curses) curses="yes"
   ;;
   --disable-iconv) iconv="no"
   ;;
-  --enable-iconv) iconv="yes"
+  --enable-iconv)
+      if test "$curses" != "no" ; then
+	  iconv="yes"
+      fi
   ;;
   --disable-curl) curl="no"
   ;;