How many Linux distributions have you tested this change on? Do you know if there are any on which it does not work?
ncurses in not installed by default on Ubuntu and so your proposed change would cause a compilation failure of OpenFOAM.
and add -lncurses to the link line if it does. This would work for Ubuntu and OpenSuSE Tumbleweed but I don't know about the others.
Dear Henry, i think that Your suggestion should be a smart solution that would work for RHEL-clones too.
echo " found <readline/readline.h> -- enabling readline support."
echo " found <ncurses.h> -- enabling readline with ncurses support."