You're right, it was probably installed by some third party software (don't know which one). BTW: There's a ticket about the problem in trac http://trac.macosforge.org/projects/macports/ticket/10651 Stefani Ryan Schmidt wrote:
On Oct 2, 2006, at 07:05, Stefani Gerber wrote:
A friend found a way to solve the problem so I'll write what worked for me in case anyone runs into the same problem. It's something about the default (apple) readline installation (or maybe a rather broken readline-installation on my system (-:). What helped was to move "/usr/local/lib/libreadline.a" and "/usr/local/include/readline" to a different folder before configure, make, sudo make install. Moved the files back afterwards and had no problems so far.
How did /usr/local/lib/libreadline.a get there? Apple does not provide anything under /usr/local. You must have installed it manually at some point, or something you used did.