> ... And it will include -lcurses if needed to link readline.
At least on my Linux box (RH 8.0), readline depends on -ltermcapnot -lcurses ... and PG's configure does figure that out.
regards, tom lane