Okay maybe I explain some of the autoconf and cross-compile basics
(apologies in case you already got it by now):

When you run ./configure, the script will assume that you want to build for
the system that you are running on, using the native (runs on linux, builds
for linux) compiler.  The configure script will find linux dependencies
using pkg-config.  And 'make install' will install into your running linux
system.

Most relevant arguments to ./configure are:
--prefix (tell it where to install to)
--host and --target (what system to compile for)

The ./configure script and the compiler will both be looking for libraries
to link against.  On linux, libraries are usually .so files (shared object),
the equivalent on windows is .dll.  So in addition to --target, you need to
set environment variables such that it does find the cross-compiled
libraries that you have previously installed into some --prefix=somefolder.

This is done by appending "somefolder" to the search path of various tools
via environment variables like PKG_CONFIG_PATH, CFLAGS (for the compiler),
LDFLAGS (for the linker) and more.  In addition, you often need to disable
some features of libraries that only work for Linux.  Stuff like
"--enable-xlib-xrender=no" or "--enable-win32-font=yes". 

Just take a look at gtk+-win32.jhbuildrc and you get the idea. This is where
jhbuild config files are great, they set all this up for you and run
./configure within the right environment and the right arguments (usually).

In theory you don't need to install packages like glib2.0-dev if you want to
build for Windows (mingw32), but sometimes it helps anyway because things
are not always perfect, and it may install a couple of useful dependencies
(like pkg-config) that you need anyway.

When you finally have built gtk+ for Windows, "make install" (called by
jhbuild) will have installed into its --prefix folder (target.dbg).
You will find the .dlls (and all the .dlls it depends on) in target.dbg/lib/.

Now the last step is to figure out where your MyPaint installation keeps
those same DLLs, and replace them with the ones that you have built.  Not
sure any more if the lib/ directory is sufficient, if you find a similar
directory structure it's probably better to copy everything (etc, include,
lib, bin, share...).  Don't delete the old stuff, unless you want to
re-compile really everything, like Python and PyGTK.  Those two will load
your libgtk.dll, but it is not neccessary to recompile them yourself because
all GTK2 .dlls should be backward compatible.

About compiling MyPaint:

It may sound funny, but you don't need GTK to compile MyPaint. The
compilation process will only link against glib and libpng (IIRC).  This is
because the only thing that needs compiling is a Python extension module. 
This module contains only the time-critical code and does not interact with
the GUI elements directly.  Instead, it does render pixels into a memory
buffer on request, and similar things.

However PyGTK (which is also a compiled Python extension module) is linked
against GTK, and will cause Python to load the GTK .dll at runtime.

About installing, when a program is running its libraries are generally
loaded into memory, so when you replace a .dll you will at least need to
restart the program to load the new library from disk.  (Unless library
technology has advanced a hell lot while I was not looking.)

Hope this helps to clarify things a bit.

-- 
Martin Renold

_______________________________________________
Mypaint-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/mypaint-discuss

Reply via email to