Re: An attempt at Win32 build instructions



OK, here's another version, with additions/corrections from building
through GTK+. Principal changes:

- Add workaround for MSYS bug with command substitution that
   affects pkg-config output
- Add the gnuwin32 Gw32c and Zlib libraries to the list of 
   packages to install.
- Add a fixup for the gnuwin32 libpng-1.2.8 library.
- Add manual running of pango-querymodules, gdk-pixbuf-queryloadres
   and gtk-query-im-modules-2.0 to work around bugs where they
   don't work uninstalled.
- Add creation of a systemwide gtkrc to turn on the MS-Windows theme

With that, success! It actually feels pretty snappy on this box...
(OK, it's a 3ghz PIV). Some things, like initial window map, are
a lot cleaner than on X. The main "performance" problems I'm seeing
are:

- Updates can get arbitrarily behind on expose when dragging
  another window on top or when resizing them. Being able to
  block rendering forever indicates that there are performance
  or scheduling problems in the non-rendering code.

- With the MS-Windows theme, some widgets (buttons) flash on
  resize.

Step 1: Install MingW and MSYS
==============================

From http://www.mingw.org/download.shtml

Download:

   MinGW-3.2.0-rc-1.exe
   MSYS-1.0.10.exe
   msysDTK-1.0.1.exe

And install them in that order, taking the default
install locations of c:\mingw and c:\msys\1.0. During
SYS installation, you'll be prompted for where you
installed mingw.

A link for MSYS will be created on your desktop, that launches
a terminal. Much work in the following will be done in that
terminal.

Note that for some of the following steps you need an editor
that can be invoked from the command line and handle Unix
line endings. vi is included with MSYS, but you may want
to use Emacs fom http://ftp.gnu.org/gnu/windows/emacs/, or
something more friendly to non-Unix-heads.

Step 2: Installing the rest of the dependencies
===============================================

From the links on http:///www.gimp.org/~tml/gimp/win32/downloads.html

Download:

   glib-2.4.7.zip
   pkgconfig-0.15.zip
   libiconv-1.9.1.tar.gz
   gettext-runtime-0.13.1.zip
   gettext-tools-0.13.1.zip

Create c:/gtk and unpack all of the zip files directly into
that directory.  zlib1.dll will need to be moved from c:/gtk
to c:/gtk/bin.

From http://gnuwin32.sourceforge.net/packages.html, download
the "Binaries" and "Developer Files" for:

   LibPng-1.2.8
   LibJpeg-6b
   LibTiff-3.6.1
   LibTiff-3.6.1
   LibGw32C-0.4
   Zlib-1.2.2
   LibTool-1.5.8 (the msys version is too old)

Unpack these all directly in c:\gtk, instead of in the default
gnuwin32 location.

A manual fixup is needed for libtool ..  edit /gtk/bin/libtoolize and 
the line that sets prefix=<default location> to prefix=/gtk.

Also libpng13.pc needs to be fixed ... edit /gtk/lib/pkg-config/libpng13.pc
and change all reference to '12' to '13'. 

(The GnuWin32 people apparently somehow broke bincompat between 
libpng-1.2.7 and libpng-1.2.8 so are being incompatible with 
the rest of the world and advertising a 'libpng13'. It's only used 
internally to the png-loader, so we can accept that under protest.)

Step 3: Set up your MSYS environment
====================================

Inside msys, edit /etc/fstab and add a line:

  c:\gtk	\gtk

Create a .cvsrc in your MSYS homedir (which is *not* the 
same as your Win32 homedir) with the line:

 cvs -z3

(This should really have 'diff -up' and 'update -dP' as well,
but something is screwed up with CVS under msys.)

Create a .profile file in your MSYS homedir (which is *not* the 
same as your Win32 homedir) with the lines:

  export CVS_RSH=ssh
  export ACLOCAL_FLAGS="-I /gtk/share/aclocal/"
  export LDFLAGS="-L/gtk/lib"
  export CPPFLAGS="-I/gtk/include"
  export PATH="/gtk/bin:$PATH"

Quit msys and rerun it to pick up these environment variables.

Step 4: Work around bug in MSYS bash
====================================

Create a file /gtk/bin/pkg-config.sh, with the contents

  #!/bin/sh
  if pkg-config "$@" > /dev/null 2>&1 ; then
    res=true
  else
    res=false
  fi
  pkg-config "$@" | tr -d \\r && $res

and add:

  export PKG_CONFIG="/gtk/bin/pkg-config.sh" 

To your .profile file. Quit msys and rerun it again to pick up this
environment variable.

Step 5: Make a fake gtk-doc
===========================

Check out gtk-doc from gnome cvs

 $ cvs -d :pserver:anonymous anoncvs gnome org:/cvs/gnome get gtk-doc

(Substitute appropriately for non-anonymous CVS.)

Inside the gtk-doc directory, copy gtkdocize.in to gtkdocize, and
edit the new file. Change:

    @PACKGAGE@ => gtk-doc
    @VERSION@ => 1.3
    @PREFIX@ => /gtk
    @datadir@ => /gtk/share

Then install a few files into place

 $ cp gtk-doc.m4 /gtk/share/share/aclocal
 $ cp gtkdocize /gtk/bin
 $ mkdir -p /gtk/share/gtk-doc/data/ 
 $ cp gtk gtk-doc.make /gtk/share/gtk-doc/data

Step 6: Building glib
=====================

Check out glib from gnome cvs

 $ cvs -d :pserver:anonymous anoncvs gnome org:/cvs/gnome get gtk-doc

Inside the glib directory

 $ run ./autogen.sh --prefix=/gtk
 $ make
 $ make install

Step 7: Building pango
======================

Repeat glib instructions, substituting pango for glib. Then
work around a bug in the 'make install' rule. (pango-querymodules
doesn't work uninstalled: #164001)

 $ pango-querymodules > /gtk/etc/pango/pango.modules

Step 8: Building atk
======================

Repeat glib instructions, substituting atk for glib

Step 9: Building gtk+
=====================

Repeat gtk+ instructions, substituting pango for glib. Then
work around a bug in the 'make install' rule. 
(gtk-query-immodules and gdk-pixbuf-query-loaders don't
work uninstalled: #164001)

 $ gtk-query-immodules-2.0 > /gtk/etc/gtk-2.0/gtk.immodules
 $ gdk-pixbuf-query-loaders > /gtk/etc/gtk-2.0/gdk-pixbuf.loaders

Set the correct default theme. Create a file 
 
 /gtk/etc/gtk-2.0/gtkrc

With the contents

 gtk-theme-name = "MS-Windows"

Step 10: Testing
================
 
 $ gtk-demo

Should bring up the GTK+ demo application.



Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]