On 2016-11-03 09:02:41 -0000, Mutt wrote:
> Comment (by vinc17):
> 
>  The problem is related to variable expansion. In
>  {{{
>  
> AC_CHECK_HEADERS($cf_ncurses/ncurses.h,[cf_cv_ncurses_header="$cf_ncurses/ncurses.h"],
>  }}}
>  the {{{cf_cv_ncurses_header="$cf_ncurses/ncurses.h"}}} part is OK since
>  this will be evaluated as a part of the shell script (the variable is
>  expanded by the shell), but the {{{$cf_ncurses/ncurses.h}}} in the first
>  argument is not OK because the shell is not involved everywhere in the
>  generated code.

With my fix (and I suppose that this was the same with the old code,
which was similar), I get:

/* Define to 1 if you have the <ncursesw/ncurses.h> header file. */
#define HAVE_NCURSESW_NCURSES_H 1

/* Define to 1 if you have the <ncurses.h> header file. */
/* #undef HAVE_NCURSES_H */

/* Define to 1 if you have the <ncurses/ncurses.h> header file. */
/* #undef HAVE_NCURSES_NCURSES_H */

in "config.h". The code is OK, but this is unexpected, and the
comments may be wrong. For instance, on a Debian machine, I have
both:

/usr/include/ncurses.h
/usr/include/ncursesw/ncurses.h

and the config.h lines above. So, the

/* Define to 1 if you have the <ncurses.h> header file. */

line is incorrect. I suppose that this could be fixed by moving
the AC_CHECK_HEADERS invocations out of the conditionals, and
putting them in the right order so that cf_cv_ncurses_header
gets the preferred value. But this would also mean that several
of the above variables could be defined at the same time and the
Mutt code needs to ensure consistency by testing the variables
in the right order.

-- 
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to