lynx-dev
[Top][All Lists]
Advanced

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

Re: [Lynx-dev] ncurses configure test needs to include term.h or termcap


From: Ryan Schmidt
Subject: Re: [Lynx-dev] ncurses configure test needs to include term.h or termcap.h too
Date: Thu, 27 Aug 2020 17:59:42 -0500

On Aug 27, 2020, at 17:39, Thomas Dickey wrote:

> On Thu, Aug 27, 2020 at 05:17:42PM -0500, Ryan Schmidt wrote:
>> Hi, I'm a developer with MacPorts, and it was reported to us that if you try
>> to configure lynx (I verified the issue with 2.8.9rel.1 and 2.9.0dev.5) with
>> CFLAGS containing -Werror -Wimplicit-function-declaration then it fails to
>> find ncurses:
> 
> I'll keep this in mind, but the port file here needs some work:
> 
> https://github.com/macports/macports-ports/blob/master/www/lynx/Portfile
> 
> (it helps to add "--with-screen=ncursesw" or "--with-screen=ncurses"
> if the ncurses port doesn't distinguish the two).
> 
> Any fixes/improvements that I make will assume that the port does that.

Sure, we can set that. With --with-screen=ncurses set, the configure output is:


checking for screen type... ncurses
checking for specific curses-directory... no
checking pkg-config for ncurses... yes
checking if the ncurses package files work... no
Looking for ncurses-config
checking for ncurses-config... no
checking for ncurses6-config... ncurses6-config
checking if we have identified curses headers... none
configure: error: No curses header-files found


>> checking if we have identified curses headers... none
>> configure: error: No curses header-files found
>> 
>> 
>> The config.log shows that the test failed because:
>> 
>> configure:18951:12: error: implicit declaration of function 'tgoto' is 
>> invalid in C99 [-Werror,-Wimplicit-function-declaration]
>> initscr(); tgoto("?", 0,0)
>>           ^
>> 1 error generated.
>> 
>> 
>> The reason appears to be that your configure test (from aclocal.m4) includes 
>> only ncurses.h and/or curses.h:
>> 
>> for cf_header in \
>>      ncurses.h ifelse($1,,,[$1/ncurses.h]) \
>>      curses.h ifelse($1,,,[$1/curses.h]) ifelse($1,,[ncurses/ncurses.h 
>> ncurses/curses.h])
>> do
>> 
>> but then it tries to compile a test program using tgoto:
>> 
>> AC_TRY_COMPILE([#include <${cf_header}>],
>>      [initscr(); tgoto("?", 0,0)],
>>      [cf_cv_ncurses_header=$cf_header; break],[])
>> done
>> 
>> At least in ncurses 6.2, tgoto is not defined in those headers; it's defined
>> in term.h and termcap.h, so you should include one of those headers too.
> 
> If I were only configuring with ncurses, it would be simple.
> 
> For everything else, the configure script has to try different
> combinations to see what works.
> 
> The --with-screen option gives it a head start along that path.

I figured there were some complexities, so I didn't dare to propose a fix 
myself.


Just to note, -Werror=implicit-function-declaration will be the default 
behavior of Apple clang soon, hence the report we received and the desire to 
fix this soon.




reply via email to

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