[Python-bugs-list] [ python-Bugs-748926 ] broken ncurses support in current cvs a last distribution

SourceForge.net noreply@sourceforge.net
Mon, 30 Jun 2003 10:24:35 -0700


Bugs item #748926, was opened at 2003-06-04 17:23
Message generated for change (Comment added) made by mmokrejs
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=748926&group_id=5470

Category: None
Group: Python 2.3
Status: Open
Resolution: Works For Me
Priority: 5
Submitted By: Martin Mokrejs (mmokrejs)
Assigned to: Nobody/Anonymous (nobody)
Summary: broken ncurses support in current cvs a last distribution

Initial Comment:
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?

----------------------------------------------------------------------

>Comment By: Martin Mokrejs (mmokrejs)
Date: 2003-06-30 19:24

Message:
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.



----------------------------------------------------------------------

Comment By: Martin Mokrejs (mmokrejs)
Date: 2003-06-17 23:37

Message:
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?
> 


----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-06-17 22:35

Message:
Logged In: YES 
user_id=21627

I see. This seems to be either a bug in ncurses, or in gcc.
Closing as third-party.

----------------------------------------------------------------------

Comment By: Martin Mokrejs (mmokrejs)
Date: 2003-06-17 16:10

Message:
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).


----------------------------------------------------------------------

Comment By: Martin Mokrejs (mmokrejs)
Date: 2003-06-17 15:00

Message:
Logged In: YES 
user_id=696559

Sorry, I'm not aprogrammer, should I attach some of the
headers files distributed by ncurses?

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-06-14 08:50

Message:
Logged In: YES 
user_id=21627

Can you report how NCURSES_EXPORT is defined on your system?


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=748926&group_id=5470