This assumes that msvcr71 support has been enabled as per the instructions in the section Removing msvcrt dependencies.
Download the source tarball for version 6b. Unpack into a convenient directory. Open the msys console and cd to the jpeg directory. Now enter the following commands to build a stripped dll.
./configure
make libjpeg.a
mv libjpeg.a in.a
dlltool --export-all-symbols -D jpeg.dll -l libjpeg.a -z in.def in.a
ranlib libjpeg.a
gcc -shared -s -def in.def -o jpeg.dll in.a
Optionally to install the include files and import library into msys's /usr/local do the following.
make install-lib
Finally put jpeg.dll somewhere within Window's dll or executable search path.
page migrated to new wiki