Building the GIMP Under Windows

"Kevin Myers" <[email protected]>
Newsgroups gmane.comp.video.gimp.windows.devel
Message-ID <001001c27d79$fc80f5e0$65c8a8c0@speedy>
Hello folks,

Below is a detailed list of my steps for building the gimp under Windows, as best as I can reconstruct them.  Please let me know if anything appears to be missing, or if you see anything that I could/should have done differently.

***WARNING***  I am a rank amateur at this stuff.  There could easily be steps that should have been done differently.  Also, I put this together largely from memory and from looking back over my files, as I don't have time to go through it all again to make certain that I haven't left anything out.  So, I could have easily omitted a few necessary steps as well.  In spite of any omissions or inaccuracies, I hope that this may at least serve as a decent starting point for some of you, and to help get you through some of the hurdles that I ran into.

If someone (Tor?) has a handy web site where this could be permanently posted, and corrected/updated as folks offer additional comments, that would be great!

Finally, I know that quite a bit of this manual grunge should NOT be necessary.  But I'm not enough of an expert at autoconf/automake/libtool to figure out how to correct and enhance the existing scripts the right way, and don't have any additional time to spend on that at the moment anyway.  If someone else wanted to try to help make this process more automated like it really should be, that would be great too!!!

All comments, suggestions, additions, and corrections appreciated.

s/KAM


Building GIMP 1.2.4 Under Windows using MinGW/mSys:

1. Download the MinGW installable binary image from http://prdownloads.sourceforge.net/mingw/MinGW-2.0.0-3.exe?download, and execute the downloaded file to install MinGW.  Accept all default settings during installation.

2. Download the mSys installable binary image from http://prdownloads.sourceforge.net/mingw/MSYS-1.0.7-i386-2.exe?download, and execute the downloaded file to install mSys.  Accept all default settings during installation.  Note there are also i586 and i686 versions.  Those would probably work also.

3. In the above steps, be sure to allow MinGW's make.exe to be renamed to something else, so that the mSys make.exe will be used instead.

4. Download all of the following packages via the links on Tor's gimpwin downloads page (http://www.gimp.org/~tml/gimp/win32/downloads.html).  More direct links to some of the files are provided for your convenience:

libiconv binary and developer's package - http://prdownloads.sourceforge.net/gettext/libiconv-1.7-w32.bin.zip?download
libintl developer's package - http://www.gimp.org/~tml/gimp/win32/libintl-0.10.40-tml-20020904.zip
gettext developer's package - http://www.gimp.org/~tml/gimp/win32/gettext-dev-0.10.40-20020904.zip
glib 2.0 developer's package - http://www.gimp.org/~tml/gimp/win32/glib-dev-2.0.6-20020802.zip
pkgconfig 0.13 binary package - http://www.gimp.org/~tml/gimp/win32/pkgconfig-0.13.zip
gtk+ 1.3 developer's package - http://www.gimp.org/~tml/gimp/win32/gtk+-dev-1.3.0-20020912.zip
gimp 1.2.4 source - http://www.gimp.org/~tml/gimp/win32/gimp-1.2.4-tml-20020907-src.zip
zlib developer's package - http://prdownloads.sourceforge.net/gnuwin32/zlib-1.1.4-lib.zip?download
libpng developer's package - http://prdownloads.sourceforge.net/gnuwin32/libpng-1.2.4-1-lib.zip?download
libjpeg developer's package - http://prdownloads.sourceforge.net/gnuwin32/libjpeg-6b-lib.zip?download
libtiff developer's package - http://prdownloads.sourceforge.net/gnuwin32/tiff-3.5.7-lib.zip?download
freetype developer's package - http://prdownloads.sourceforge.net/gnuwin32/freetype-2.1.2-1-lib.zip?download
Tor's gimp pspi plug-in source package - http://www.gimp.org/~tml/gimp/win32/gimp-pspi-1.0.2-src.zip

I also downloaded and built pkgconfig 0.14.0, and can provide instructions for how to do that if anyone is interested.  However, I don't think that is actually required to build the gimp.

I also made rather brief attempts to download, build, and/or use each of the following, but ran into various problems and did NOT end up using these.  As a result, there were perhaps a half dozen or so of the gimp plug-ins that could not be built.  However, at least two of those (gimp-print and web browser) were things that I didn't care about anyway, since equivalent functionality (printing and web browser) is provided under Windows by other means:

aa library - couldn't figure out where to get this one
gimp-print source package - http://prdownloads.sourceforge.net/gimp-print/gimp-print-4.2.3.tar.gz?download
mpeg source package - can't remember where I found this one
xpm 4.0.3 developer's package - http://www.gimp.org/~tml/gimp/win32/xpm-nox-dev-4.0.3-20020112.zip
perl 5.6.1 installable binary distribution - http://downloads.activestate.com/ActivePerl/Windows/5.6/ActivePerl-5.6.1.633-MSWin32-x86.msi

Finally, I did not attempt to build any of the "unofficial" gimp plug-ins.

Maybe someone else can do better regarding the above issues.

5. Use WinZip (or extractor of your choice) to extract each of the previously downloaded packages into the following directory structure (generally one package per subdirectory, only top level of each subdirectory listed below):

d:\source\freetype-2.1.2-1-lib
d:\source\gettext-dev-0.10.40-20020904
d:\source\gimp-1.2.4 - (This was a subdirectory of the gimp-1.2.4-tml-20020907-src package.)
d:\source\gimp-print-4.2.3.tar
d:\source\gimp-pspi-1.0.2-src
d:\source\glib-dev-2.0.6-20020802
d:\source\gtk+-dev-1.3.0-20020912
d:\source\libiconv-1.7-w32.bin
d:\source\libintl-0.10.40-tml-20020904
d:\source\libjpeg-6b-lib
d:\source\libpng-1.2.4-1-lib
d:\source\mpeg2dec-0.2.1-cvs
d:\source\pkgconfig-0.13
d:\source\tiff-3.5.7-lib
d:\source\unofficial-plug-ins - (This was a subdirectory of the gimp-1.2.4-tml-20020907-src package.)
d:\source\xpm-nox-dev-4.0.3-20020112
d:\source\zlib-1.1.4-lib

6. Per Tor's instructions:  Move the DLLs and LIBs from d:\source\libiconv-1.7-w32.bin into d:\source\libiconv-1.7-w32\lib, and move the EXE file into d:\source\libiconv-1.7-w32.bin\bin.  Copy d:\source\libiconv-1.7-w32.bin\lib\iconv.lib to d:\source\libiconv-1.7-w32.bin\lib\libiconv.a.

7. Fire up mSys using the supplied Start Menu shortcut under the MinGW group.

8. mkdir /usr/local/bin, /usr/local/lib, and /target subdirectories.  

9. Copy all of the following files into /usr/local/lib: iconv.dll and localcharset.dll from /d/source/libiconv-1.7-w32/lib, and libintl-1.dll from /d/source/libintl-0.10.40-tml-20020904/lib.  

10. Copy all of the following files into /usr/local/bin: all eight *.exe files from /d/source/gettext-dev-0.10.40-20020904/bin, all files from /d/source/glib-dev-2.0.6-20020802/bin, iconv.exe from /d/source/libiconv-1.7-w32.bin/bin, pkg-config.exe from /d/source/pkgconfig-0.13/bin, cxpm.exe from /d/source/xpm-nox-dev-4.0.3-20020112/bin to /usr/local/bin.

11. cd into d:\source\gimp-1.2.4 .

12. Create a file named configure.kam with the following contents:

#!/bin/sh

export PKG_CONFIG_PATH=\
D:\\source\\gettext-dev-0.10.40-20020904\\lib\\pkgconfig\;\
D:\\source\\glib-dev-2.0.6-20020802\\lib\\pkgconfig\;\
D:\\source\\gtk+-dev-1.3.0-20020912\\lib\\pkgconfig
echo PKG_CONFIG_PATH=$PKG_CONFIG_PATH

# specify any necessary compiler flags here
export CFLAGS='-mcpu=pentiumpro'
echo CFLAGS=$CFLAGS

# specify pre-processor flags here, with any required include paths (-I)
export CPPFLAGS=\
-I/d/source/libiconv-1.7-w32.bin/include\ \
-I/d/source/gettext-dev-0.10.40-20020904/include\ \
-I/d/source/glib-dev-2.0.6-20020802/include/glib-2.0\ \
-I/d/source/gtk+-dev-1.3.0-20020912/include/gdk\ \
-I/d/source/gtk+-dev-1.3.0-20020912/include/gtk\ \
-I/d/source/zlib-1.1.4-lib/include\ \
-I/d/source/libpng-1.2.4-1-lib/include\ \
-I/d/source/libjpeg-6b-lib/include\ \
-I/d/source/tiff-3.5.7-lib/include\ \
-I/d/source/freetype-2.1.2-1-lib/include\ \
-I/d/source/xpm-nox-dev-4.0.3-20020112/include
echo CPPFLAGS=$CPPFLAGS

# specify linker flags here, with any required library paths (-L)
export LDFLAGS=\
-L/d/source/libiconv-1.7-w32.bin/lib\ \
-L/d/source/libintl-0.10.40-tml-20020904/lib\ \
-L/d/source/gettext-dev-0.10.40-20020904/lib\ \
-L/d/source/glib-dev-2.0.6-20020802/lib\ \
-L/d/source/gtk+-dev-1.3.0-20020912/lib\ \
-L/d/source/zlib-1.1.4-lib/lib\ \
-L/d/source/libpng-1.2.4-1-lib/lib\ \
-L/d/source/libjpeg-6b-lib/lib\ \
-L/d/source/tiff-3.5.7-lib/lib\ \
-L/d/source/freetype-2.1.2-1-lib/lib\ \
-L/d/source/xpm-nox-dev-4.0.3-20020112/lib
echo LDFLAGS=$LDFLAGS

./configure --disable-static --disable-perl --disable-print --srcdir=`pwd` --prefix=`pwd`

13. Edit Makefile.in (and/or Makefile.am if desired), remove the line for intl from the SUBDIRS variable.

14. Edit configure (and/or configure.in if desired), replace all occurances of -fnative-struct with -mms-bitfields.

15. Edit ./app/Makefile.in (and/or Makefile.am if desired), and add the following dependency info for gimp.def:

# 2002/10/24 KAM added gimp.def to correct omission per email thread with Tor Lillqvist
gimp.def: gimp.sym
echo EXPORTS >$@
cat $< >>$@

16. Edit ./build/win32/compile-resource, replace bash with sh in the first line.

17. Edit ./build/win32/make.mingw, replace all occurances of -fnative-struct with -mms-bitfields.

There were a few additional changes that I made which I later decided probably weren't necessary, so I have not included those changes here.  I don't have time to do things over and confirm for certain whether they really weren't needed.  If you run into any problems (watch out for error messages related to regarding DATADIR and libgimpapp.a) then let me know and I can provided additional info.

18. Run ./configure.kam .  It should get all the way through with warnings about a few plug-ins that won't be built.

19. Run make .  If things are working as they did for me, this should build everything in the tools, libgimp, app, plugins, and modules subdirectories.  Then make will abort with an error in the po subdirectory.

20.  cd into each of the po, po-libgimp, po-plugins, po-script-fu, and tips subdirectories, and run make -f makefile.mingw in each one separately.

21. cd into each of the data, help, devel-docs, and build subdirectories, and run make in each one separately.

22. Repeat steps 19 through 21, except adding the install parameter to each of the make commands.

23. Copy all subdirectories of /target recursively into /d/source/gimp-1.2.4.  This will merge their contents into subdirectories of the same names that have already been created by other steps, and is necessary due to hardcoded paths in some of the makefile.mingw files that I didn't feel like changing.

24. If I haven't omitted any steps (there were too many, I could have easily forgotten a few), then you should now have a copy of the gimp executable in /d/source/gimp-1.2.4/bin/gimp.exe.  Try running that from Windows.  It should start up ok, but you will notice that many features are missing from the menus.

25. Go into the File->Preferences dialogue, and expand the Directories preferences.  Set appropriate directories for temp and swap directories.  Point Brushes to D:\source\gimp-1.2.4\share\gimp\1.2\brushes.  Point Patterns to D:\source\gimp-1.2.4\share\gimp\1.2\patterns.  Point Palettes to D:\source\gimp-1.2.4\share\gimp\1.2\palettes.  Point gradients to D:\source\gimp-1.2.4\share\gimp\1.2\gradients.  Point plug-ins to D:\source\gimp-1.2.4\lib\gimp\1.2\plug-ins.  There may be a few additional directory settings that would be appropriate, especially for Modules and Generated Brushes, but I didn't know what to set those to.  I'd be curious to know if the tail end of the regular make script that was never executed would have normally handled these things...?  I didn't have time to investigate.

26. Exit and re-start the gimp.  At this point, most everything in the gimp except for a few specific plug-ins should be operational.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.