[MacPorts] #71123: aalib @1.4rc5: aacurses.c: error: dereferencing pointer to incomplete type (was: aalib fails to build against current ncurses: aacurses.c: error: dereferencing pointer to incomplete type)
MacPorts
noreply at macports.org
Sun Nov 10 10:14:20 UTC 2024
#71123: aalib @1.4rc5: aacurses.c: error: dereferencing pointer to incomplete type
---------------------------+------------------------------
Reporter: barracuda156 | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.10.2
Resolution: | Keywords: leopard haspatch
Port: aalib |
---------------------------+------------------------------
Changes (by ryandesign):
* keywords: => leopard haspatch
Comment:
I see the two reporters are both using Mac OS X 10.5.8, one with Apple gcc
4.2 and the other with MacPorts gcc 14.
I was not able to reproduce this problem on macOS 12.7.5, neither using
Apple clang 14 nor MacPorts clang 19 nor MacPorts gcc 14. I usually want
to be able to reproduce a problem before applying a fix, to verify that
the proposed fix actually works, so I did some investigating.
These lines in the provided logs caught my eye:
{{{
:info:configure configure: checking "location of curses"...
:info:configure checking for initscr in -lncurses... yes
:info:configure Found ncurses on /usr/include/ncurses.h
}}}
{{{
:info:configure Display drivers:
:info:configure curses
:info:configure Keyboard drivers:
:info:configure curses
:info:configure Mouse drivers:
:info:configure curses
}}}
On macOS 12 I instead get:
{{{
configure: checking "location of curses"...
}}}
{{{
Display drivers:
Keyboard drivers:
Mouse drivers:
}}}
and on macOS 12 the programs don't actually get linked with ncurses.
Because we have not told the configure script where ncurses is, it decides
to look for it in /usr/include, and when it doesn't find it (on macOS
10.14 and later, since headers aren't there anymore), it disables ncurses
support. This can be fixed by changing `--with-ncurses` to `--with-
ncurses=${prefix}`. After that change, I correctly see the ncurses
6.5-related build failure and can confirm that applying the suggested fix
does allow the build to succeed. Setting `-DNCURSES_OPAQUE=0` isn't needed
anymore either.
One remaining problem to be addressed before committing a fix:
{{{
% aalib-config --libs
-L/opt/local/lib -laa -lm -L/opt/local/lib -lncurses
}}}
`-L/opt/local/lib -lncurses` needs to not appear here. This causes
software that uses aalib to be overlinked with ncurses. This would be
necessary if using the aalib static library, but we already disable that
in the port using `--disable-static`.
--
Ticket URL: <https://trac.macports.org/ticket/71123#comment:6>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list