Hi
Any reason for building the same version by yourself ?
Regarding the above error, I guess you have ncurses-devel package installed in your system. The headers file provided by this package is used while building and creating some side effects.
This means, we built AIX toolbox readline package without this ncurses-devel.
So if you want to build readline by yourself, you can unsintall this devel package temploraily then build readline using the same steps.
And once readline is built, and you do want to use ncurses-devel for some other purpose, you can install again.
Thanks
Ranjit