This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: broken ncurses support in current cvs and last distribution
Type: Stage:
Components: None Versions: Python 2.3
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: loewis, mmokrejs
Priority: normal Keywords:

Created on 2003-06-04 15:23 by mmokrejs, last changed 2022-04-10 16:09 by admin. This issue is now closed.

Messages (8)
msg16233 - (view) Author: Martin Mokrejs (mmokrejs) Date: 2003-06-04 15:23
I found configure looks for ncurses.h instead of
ncurses/ncurses.h. Please note that newer version of
ncurses have moved ncurses.h to a subdirectory ncurses/.

Even after fixing configure and
Modules/_curses_panel.c, I get:

cc: Error: /software/@sys/usr/include/ncurses/curses.h,
line 506: Missing identifier. (parnoident)
extern NCURSES_EXPORT(int) addch (const chtype);      
                 /* generated */
---------------------------^
cc: Error: /software/@sys/usr/include/ncurses/curses.h,
line 507: Missing identifier. (parnoident)
extern NCURSES_EXPORT(int) addchnstr (const chtype *,
int);             /* generated */
---------------------------^
cc: Error: /software/@sys/usr/include/ncurses/curses.h,
line 508: Missing identifier. (parnoident)
extern NCURSES_EXPORT(int) addchstr (const chtype *); 
                 /* generated */
---------------------------^

Any ideas?
msg16234 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-06-14 06:50
Logged In: YES 
user_id=21627

Can you report how NCURSES_EXPORT is defined on your system?
msg16235 - (view) Author: Martin Mokrejs (mmokrejs) Date: 2003-06-17 13:00
Logged In: YES 
user_id=696559

Sorry, I'm not aprogrammer, should I attach some of the
headers files distributed by ncurses?
msg16236 - (view) Author: Martin Mokrejs (mmokrejs) Date: 2003-06-17 14:10
Logged In: YES 
user_id=696559

I asked the developer of ncurses. This is his first reply.

From: Thomas Dickey <dickey@herndon4.his.com>

My guess (because I've seen it a few times)
is that it's a system where someone installed a new version
of gcc. Its fixincludes script was modified a year or two
ago with the effect of putting a copy of curses.h into gcc's
so-called fixed-include files, e.g.,

        /usr/lib/gcc-lib/i386-linux/3.0.4/include

(It's "fixing" a place which is providing a typedef if it
doesn't exist). I modified the ifdef's to avoid this
problem.  The quick fix is to remove curses.h from gcc's
fixed-includes.  The reason why NCURSES_EXPORT is not
defined is because gcc finds the wrong curses.h and doesn't
find ncurses_dll.h because its fixed-include forces it into
the wrong search path.

If it's not that - perhaps more info.  (Perhaps just setting
$CPPFLAGS in the environment is needed).
msg16237 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-06-17 20:35
Logged In: YES 
user_id=21627

I see. This seems to be either a bug in ncurses, or in gcc.
Closing as third-party.
msg16238 - (view) Author: Martin Mokrejs (mmokrejs) Date: 2003-06-17 21:37
Logged In: YES 
user_id=696559

Second reply(I have to add I'll retry once more, but I
believe the whole story is python used to compile fine with
older ncurses, which placed headers into include/ . Newer
versions place headers into include/ncurses/ subdirectory,
and that is not expected. I do not have the gcc problem with
gcc fixincludes as the machine was recently installed and
there were always ncurses 5.0 and above installed.):

> Hi Thomas,
>   but I use cc from DEC?DIGITAL/COMPAQ/HP, so it shouldn't
see those
> "fixed" headers, right?

no - gcc is the one that "fixes" headers.  It is unlikely
that your $CFLAGS
or $CPPFLAGS has an explicit
        -I/usr/lib/gcc-lib/i386-linux/3.0.4/include

Then it sounds like a variation of the other sort of
problem:  compiler finds
one of the headers, but not all.  The message seems to
indicate that the
compiler did not find a definition for NCURSES_EXPORT, which
is defined in
ncurses_dll.h

What I'd look for: since most applications do not distinguish
        #include <ncurses/curses.h>
and
        #include <curses.h>
by ifdef's is that your options have only
        -I/software/@sys/usr/include/ncurses
rather than
        -I/software/@sys/usr/include
        -I/software/@sys/usr/include/ncurses
Since the ncurses headers (unctrl.h, term.h) will have a
line like
        #include <ncurses/curses.h>
it really needs both -I options.  (Specifying both still
does not work around
the gcc fixincludes problem - that's why I remember that one
first).
 
> > (It's "fixing" a place which is providing a typedef if
it doesn't exist).
> > I modified the ifdef's to avoid this problem.  The quick
fix is to remove
> > curses.h from gcc's fixed-includes.  The reason why
NCURSES_EXPORT is not
> > defined is because gcc finds the wrong curses.h and
doesn't find ncurses_dll.h
> > because its fixed-include forces it into the wrong
search path.
> >
> > If it's not that - perhaps more info.  (Perhaps just
setting $CPPFLAGS in
> > the environment is needed).
> 
> But the message
> 
> cc: Error: /software/@sys/usr/include/ncurses/curses.h,
> line 506: Missing identifier. (parnoident)
> extern NCURSES_EXPORT(int) addch (const chtype);
> /* generated */
> ---------------------------^
> cc: Error: /software/@sys/usr/include/ncurses/curses.h,
> line 507: Missing identifier. (parnoident)
> extern NCURSES_EXPORT(int) addchnstr (const chtype *,
> int); /* generated */
> ---------------------------^
> cc: Error: /software/@sys/usr/include/ncurses/curses.h,
> line 508: Missing identifier. (parnoident)
> extern NCURSES_EXPORT(int) addchstr (const chtype *);
> /* generated */
> ---------------------------^
> 
> confirms that CPPFLAGS or CFLAGS point to the location
where ncurses are
> installed! Maybe the problem is that ncurses/ncurses.h are
stored as
> ncurses/curses.h?
> 
msg16239 - (view) Author: Martin Mokrejs (mmokrejs) Date: 2003-06-30 17:24
Logged In: YES 
user_id=696559

Hi,
  so the problem is that I have to manually specify
-I/software/@sys/usr/include
-I/software/@sys/usr/include/ncurses under BASECFLAGS in
src/Makefile. If I set these includes on CPPFLAGS, they're
used only for building the python core, not the modules.

  I believe the configure should test for both:

<ncurses.h>
<ncurses/ncurses.h>

ncurses-5.3 and newer install into $prefix/include/ncurses/
instead of former $prefix/include/.

This change should be reflected by the configure script.


I believe the dist/src/Modules/_curses_panel.c calling
panel.h should be adjusted properly. It is not a must as
long as configure will set -I$pref/include
-I$pref/include/ncurses.

msg16240 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-07-01 17:15
Logged In: YES 
user_id=21627

Well, that is not the problem you have originally reported? I 
completely lost track what the problem is that you are 
reporting.

If so, please close this report, and submit a new one indicating
1. What you did.
2. What happened.
3. What you expected to happen instead.
4. (optionally) why you think that happened.
History
Date User Action Args
2022-04-10 16:09:02adminsetgithub: 38587
2003-06-04 15:23:40mmokrejscreate