I needed to draw some charts using gnuplot. Downloading and installing as usual (configure, make, make install) led to a lot of errors. So I looked around and found this solution:

# ./configure –with-readline=builtin

If you need PDF support you have to install pdflib first:

# sudo port install pdflib
# ./configure –with-readline=builtin --with-pdf=/usr/local/lib/pdflib-config

You need to have MacPorts installed.

And that was it. You can now run gnuplot from the command line and create beautiful charts.