error: jpeglib.h: No such file or directory compiling gd
I have tried compiling libjpeg with --prefix=/usr/local explicitly set at configure time, but reflecting that path in the --with-jpeg=DIR just doesn't place nice either.
To fix this, it seems you have to point at a specific target in the libjpeg makefile by configuring with the following before compiling libjpeg:
./configure --prefix=/usr/local && make && make install && make install-lib
including 'make install-lib' will save your day. This places the libjpeg library in a location where everyone else can see it - don't ask me wny you can't just point to it with your --with-jpeg=DIR option (when compiling gd).. I've not dug down to figure why that doesn't work.