Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

broken ncurses support in current cvs and last distribution #38587

Closed
mmokrejs mannequin opened this issue Jun 4, 2003 · 8 comments
Closed

broken ncurses support in current cvs and last distribution #38587

mmokrejs mannequin opened this issue Jun 4, 2003 · 8 comments

Comments

@mmokrejs
Copy link
Mannequin

mmokrejs mannequin commented Jun 4, 2003

BPO 748926
Nosy @loewis

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2003-07-01.17:15:13.000>
created_at = <Date 2003-06-04.15:23:40.000>
labels = []
title = 'broken ncurses support in current cvs and last distribution'
updated_at = <Date 2003-07-01.17:15:13.000>
user = 'https://bugs.python.org/mmokrejs'

bugs.python.org fields:

activity = <Date 2003-07-01.17:15:13.000>
actor = 'loewis'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['None']
creation = <Date 2003-06-04.15:23:40.000>
creator = 'mmokrejs'
dependencies = []
files = []
hgrepos = []
issue_num = 748926
keywords = []
message_count = 8.0
messages = ['16233', '16234', '16235', '16236', '16237', '16238', '16239', '16240']
nosy_count = 2.0
nosy_names = ['loewis', 'mmokrejs']
pr_nums = []
priority = 'normal'
resolution = 'works for me'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue748926'
versions = ['Python 2.3']

@mmokrejs
Copy link
Mannequin Author

mmokrejs mannequin commented Jun 4, 2003

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?

@mmokrejs mmokrejs mannequin closed this as completed Jun 4, 2003
@mmokrejs mmokrejs mannequin closed this as completed Jun 4, 2003
@loewis
Copy link
Mannequin

loewis mannequin commented Jun 14, 2003

Logged In: YES
user_id=21627

Can you report how NCURSES_EXPORT is defined on your system?

@mmokrejs
Copy link
Mannequin Author

mmokrejs mannequin commented Jun 17, 2003

Logged In: YES
user_id=696559

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

@mmokrejs
Copy link
Mannequin Author

mmokrejs mannequin commented Jun 17, 2003

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

@loewis
Copy link
Mannequin

loewis mannequin commented Jun 17, 2003

Logged In: YES
user_id=21627

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

@mmokrejs
Copy link
Mannequin Author

mmokrejs mannequin commented Jun 17, 2003

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

@mmokrejs
Copy link
Mannequin Author

mmokrejs mannequin commented Jun 30, 2003

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.

@loewis
Copy link
Mannequin

loewis mannequin commented Jul 1, 2003

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants