It's too slow for ingress to perform configure, and an error is reported from time to time ..) so I use Ubuntu for cross-compilation. configure is quite fast. jhbuild was born for the gnome project. Compiling GTK may be the most convenient. the advantage of using jhbuild is that you don't have to handle the dependencies of GTK on your own, so compilation can be a breeze.
The GTK project is very large and inconvenient to compile, Especially static compilation.
Using mingwand msyscompilation in Windows is too slow. (It is too slow to use bash.exe for configure, and an error is reported from time to time ..)
So I use Ubuntu for cross-Compiling. configure is quite fast.
Jhbuild was born for the huge gnome project. It may be the most convenient to compile GTK. The advantage of using jhbuild is that you don't have to handle the dependencies of GTK yourself. Compilation can be done in one breath.
I compiled GTK 2.16, And I compiled according to the prompts on this page: http://live.gnome.org/GTK+/Win32/CrossCompilingJhbuild
How can I compile GTK3 2.16? In fact, 3 is not stable, 2.16 is the most stable version, and the cross-platform compilation project package is only 2.16.
My system is Ubuntu 11.04, which is compiled and installed under $ home.
First install mingw. You can directly install it:
Sudo apt-get install mingw32
The system automatically handles dependencies and automatically downloads two more packages: mingw32-binutils mingw32-runtime
Then install jhbuild. In fact, the system also comes with this source, you can directly
Sudo apt-get install jhbuild
Note that it is troublesome to install the source code on the webpage.
Then run jhbuild and prompt that the file $ home/. jhbuildrc is not available. Create a new file. The file can only have two lines, which are mainly used for configuration.
Checkoutroot = OS. path. expanduser ('~ /Checkout/gnome ')
Prefix = '/home/ww/gtkout'
# This is my own directory. This file is useless.
Then download jhbuild. mingw. gtk-2.16.tgz. This is the project package, less than 1 M, it will automatically download the dependent package.
Http://live.gnome.org/GTK+/Win32/CrossCompilingJhbuild? Action = AttachFile & do = view & target = jhbuild. mingw. gtk-2.16.tgz
In logs.
Decompress the package and follow the instructions on the webpage,
I have read the following files, which are some script files, such as configure. in, configure, and makefile. These scripts describe the dependency ....
Tar xzf jhbuild. mingw. gtk-2.16.tgz
Cd jhbuild. mingw. gtk-2.16
./Cross-build-gtk-rls
It automatically downloads zlib, png, glib, cairo, xml2, jpeg, iconv, pixman, atk, freetype, tiff, gtk, etc.
Very convenient, much better than self-compiled.
Note that zlib, gettext, and gtk-io are all patched! I think this is also the key to my previous compilation failure (I didn't care about the patch when compiling the GTK library)
Take a look at the gtk +-win32.jhbuildrc file and you will find many disable files, such as -- disable-gtk-doc.
So the compilation was very fast and it took only 10 minutes to compile (but it took a long time to troubleshoot the problem)
It uses wget to download. This download is very slow. You can also download it separately. Check the gtk +-win32.moduleset file.
Find the version number one by one download, and then put the file under jhbuild. mingw. gtk-2.16/checkout. rls on the line. Pay attention to the version must be the same
GTK 2.16 is indeed old!
During the download process, it will go to zlib.net to download zlib 1.2.5. This page seems to be under a wall or already over. You cannot download it. Baidu!
During the download process, it will also download pixman 0.19.2, but this seems to be an obsolete version. The download page has already deleted it, but it can be replaced by a higher version.
Copying the pixman package directly does not work because the configuration file carries md5 verification (prevents errors during download)
Download pixman 0.20.2 (Baidu). Use the built-in system command to get md5:
Md5sum pixman-0.20.2
Then to $ home/jhbuild. mingw. gtk-2.16/gtk +-win32.moduleset to change the md5 value and file name (it is best not to change version = "0.19.2" this)
Code similar to this:
Previously, I compiled freetype, fontconfig, gettext, glib, cairo, pango .....
During the compilation process, you should also pay attention to setting the pkg-config path for environment variables and some troublesome errors. If a compilation fails, the next step is impossible.
Just by clarifying its dependencies, you will be dizzy ......
Therefore, it is very convenient to use jhbuild. jhbuild was born for gnome. It may be the most convenient to compile GTK.
If the above compilation is successful, it means there are no errors... (the final demo is not completed during the compilation process)
Now let's take a look at static compilation.
Check out gtk +-win32.jhbuildrc.
This file contains the following sentence:
Autogenargs + = '-- disable-static'
That is, it only compiles the dynamic library and changes it:
Autogenargs + = '-- enable-static -- disable-shared'
However, compilation will fail! You need to clear the GTK project and re-compile it. (I encountered an error during the compilation process ...)
The compilation was successful, but GTK +, that is, the final project got stuck .....
Glib, cairo, and pango are all successful... that is, GTK gets stuck and says pango is not found ......
Think about it later ..
I am wondering if I can replace the content in the gtk +-win32.moduleset file to compile GTK3! Replace pixman one by one ....
The most troublesome issue is the patch .....