-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.win32
executable file
·134 lines (107 loc) · 5.46 KB
/
README.win32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
Here is a small howto about installing LablGtk2 on Win32
Binary installation
The binary distribution includes the lablglade, lablrsvg, and
lablgnomecanvas libraries.
0) Both MSVC and mingw versions of ocaml 3.11 should work.
If you want to do custom linking (either ocamlc -custom, or ocamlopt),
get a recent version of flexdll. Standard ocamlc linking only
requires dlls.
1) Install the gtk2 libraries and dependencies.
This binary distribution was built using the "bundle" package at
ftp://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/
(mirrors list at: ftp://ftp.gnome.org/pub/gnome/MIRRORS)
Just follow the instructions in the README file inside the package.
If you want to use the extension libraries (currently lablglade,
lablrsvg and lablgnomecanvas are supported), you must also install
the (numerous) dependencies. Here is what was used during
compilation:
libglade-2.6.4 (requires libxml2)
libgnomecanvas-2.30.1 (requires libart_lgpl)
librsvg-2.32.1 (requires libcroco and libgsf)
gtksourceview-2.10
If you want to do custom linking, you need also the dev packages.
All of these are available in the above win32 and
win32/dependencies directories.
The distribution was compiled using the gtk+ bundle of 20120208,
but other versions should work too.
After unzipping all those archives in a common location (e.g. c:\Gtk),
it may be a good idea to go to c:\Gtk\bin and run
chmod +x *.dll
as some of the exta DLL's do not have the execution flag set.
Also, do not forget to add this binary directory to your path.
Open Control Panel/User account/Environment variables, and edit
either the personal or system variable Path to add c:\Gtk\bin.
If you cannot modify system variables directly, you can override
them by adding a fresh variable to your own environment:
Variable name: Path
Value: c:\Gtk\bin;%Path%
2) Install lablgtk2 binaries and scripts inside the OCaml distribution
bin/* -> bin
lib/site-lib/lablgtk2 -> lib/site-lib/lablgtk2
Then edit lib/ld.conf, and add the line
<path to ocaml>\lib\site-lib\lablgtk2
3) If your distribution is newer than 4.00.0, go to the
lib/site-lib/lablgtk2 directory and execute
ocaml build.ml
You must also do that everytime you update your OCaml distribution.
This will recompile the ocaml part of the library (the C part is
already compiled.)
It may fail on the native code version (using ocamlopt) if the
assembler is not on your path. Look in the Objective Caml windows
documentation for what is needed, and check that you have a working
installation by compiling and linking a trivial program.
Note also that the autodection for mingw is not fool-proof
(lablgtk2 has to be installed at the expected location), so
if the OCaml port annouced by build.ml is not the right one, you
should specify it by hand inside build.ml.
4) Test in examples
lablgtk2 testgtk.ml
See also the "Windows port" section of the main LablGtk2 README for
important remarks on threads on Windows.
5) For custom linking or native code, you need to use the export
libraries in the above DLL package. There is not default place to
put them, so you should specify that at link time:
ocamlopt -ccopt "-LC:/gtk/lib" -I +lablgtk2 lablgtk.cmxa \
gtkInit.cmx testgtk.ml -o testgtk.exe
Again, if this fails you must make sure that your ocamlopt really works,
and that all paths are correctly specified.
Full compilation with MSVC or mingw (for the brave)
0) You will need the MSVC or mingw version of ocaml 3.11 or more,
and cygwin development tools. You must also install flexdll
(at least 0.7) from
http://alain.frisch.fr/flexdll.html
(Flexdll is already included in the OCaml 4.00.0 installer)
1) Install Gtk 2: use the precompiled binaries available at
ftp://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/
This time you need the developper version.
Do NOT even try to compile it yourself from scratch.
Try to compile a small hello-gtk.c (see the tutorial page on
http://www.gtk.org) before going further.
You may unzip optional libraries available from
http://ftp.gnome.org/pub/gnome/binaries/win32
in c:\GTK.
For example to have GtkSourceView 1 support, you have to unzip :
libgnomeprint-dev.xxx.zip
libgnomeprint.xxx.zip
libart_gpl-dev.xxx.zip
libart_gpl-dev.xxx.zip
libxml2-dev.xxx.zip
libxml2.xxx.zip
win_iconv_dll-tml-xxx.zip
gtksourceview-dev.1.xxx.zip
gtksourceview.1.xxx.zip
If you need to check that all dependencies are installed, use
pkg-config --libs gtksourceview-1.0
and see if an error is reported.
3) For MSVC, copy config.make.msvc to config.make, and edit it
to set GTKROOT.
On Mingw you should be able to run the configure script:
./configure --disable-gtktest
If you do want to perform configuration time Gtk C tests the define
CYGWIN=nobinmode before running ./configure.
The rationale behind CYGWIN=nobinmode is that pkg-config is a
native windows program which outputs \r\n instead of usual unix \n.
The CYGWIN variable forces the shell to strip down all \r from
command answers. (But the tests may still fail for other reasons.)
4) Simply do "make" and "make opt" for the native version.
5) Install ("make install" or "make old-install") and test.