nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] --disable-nanorc does not disable support and use of na


From: Mike Frysinger
Subject: Re: [Nano-devel] --disable-nanorc does not disable support and use of nanorc
Date: Wed, 26 Mar 2014 20:58:11 -0400
User-agent: KMail/4.12.3 (Linux/3.13.0; KDE/4.12.3; x86_64; ; )

On Wed 26 Mar 2014 20:42:41 Benno Schulenberg wrote:
> In the past, apparently, some things were not enabled by default,
> for example the use of nanorc files and of colours.  The latter needs
> the first, so --enable-color would automatically activate --enable-nanorc.

the configure help strings make it read like these features were enabled by
default already and you had to explicitly opt out.  i think enabling all these
cool features by default makes sense rather than forcing people to opt in to
specific ones.

> But now... things are reversed, nanorc files and colours default to on,
> but the logic has not been adapted, so configuring with just
> --disable-nanorc will be overridden by the implicit --enable-color.  To my
> mind it should be the other way around: a --disable-nanorc should
> automatically activate --disable-color, because colours cannot function
> without nanorc files.
> 
> How to fix that?

i think we need to barf when we get conflicting options.  so in this case, you
want something like:

--- a/configure.ac
+++ b/configure.ac
@@ -146,10 +146,17 @@ fi
 
 AC_ARG_ENABLE(color,
 AS_HELP_STRING([--disable-color], [Disable color and syntax highlighting]))
+if test "x$enable_nanorc" = xno; then
+    if test "x$enable_color" = xyes; then
+       AC_MSG_ERROR([--enable-color cannot work with --disable-nanorc])
+    else
+       enable_color=no
+    fi
+fi
+
 if test "x$enable_color" != xno; then
     if test x$ac_cv_header_regex_h = xyes; then
-       AC_DEFINE(ENABLE_NANORC, 1, [Define this to use .nanorc files.])
-       nanorc_support=yes
+       enable_nanorc=yes
        AC_DEFINE(ENABLE_COLOR, 1, [Define this to have syntax highlighting, 
requires regex.h and ENABLE_NANORC too!])
        color_support=yes
     elif test "x$enable_color" = xyes; then

this will fall through below to the nanorc logic below, so you clean up
duplicated code too :)

> Also, --disable-utf8 and --enable-utf8 do not seem to have any effect,
> configuration always chooses the 'auto' value.

this one i broke.  patch below.

--- a/configure.ac
+++ b/configure.ac
@@ -176,9 +176,8 @@ if test "x$enable_nanorc" != xno; then
 fi
 
 AC_MSG_CHECKING([whether to enable UTF-8 support])
-enable_utf8=auto
 AC_ARG_ENABLE(utf8, AS_HELP_STRING([--enable-utf8], [Enable UTF-8 support]))
-AC_MSG_RESULT($enable_utf8)
+AC_MSG_RESULT(${enable_utf8:-auto})
 
 AC_MSG_CHECKING([whether to use slang])
 CURSES_LIB_NAME=""
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]