forked from gtk-gnutella/gtk-gnutella
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.xmingw
194 lines (158 loc) · 4.72 KB
/
README.xmingw
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
NOTE: This document isn't finished at all. This contains the first
instructions to build gtk-gnutella for win32.
This document describes how to setup gtk-gnutella for cross-compiling on a
Linux system, using xmingw to compile as a windows program.
As my Linux distribution is based on gentoo, I'll describe the steps involved
to setup xmingw, the necessary libraries and finally how to build
gtk-gnutella.
I have made the assumption that your xmingw installation will be under
/opt/xmingw and all extra installed libraries, include files etc. will be
installed in /opt/xmingw/local.
First, the xmingw cross-compile environment needs to setup. Under gentoo this
is as easy as:
$ emerge xmingw-binutils xmingw-gcc xmingw-w32api xmingw-runtime
By the way, if you also want a C++ compiler under your xmingw, you need to
emerge xmingw-gcc twice. gtk-gnutella doesn't need one though.
Next thing we need is the gtk+ devel packages for mingw. You could either
compile all needed packages by hand, or take the easy road and grab them from
the gaim project:
http://prdownloads.sourceforge.net/gaim/gtk-dev-2.6.9-rev-a.tar.gz
(from http://gaim.sourceforge.net/win32/build.php)
extract the sources, and move everything from the gtk_2_0 directory to
/opt/xmingw/local:
$ tar -zxvf gtk-dev-2.6.9-rev-a.tar.gz
$ mv -- gtk_2_0/* /opt/xmingw/local/
You should now have something like this:
$ ls /opt/xmingw/local/
bin
build.sh
include
lib
version.sh
$ ls /opt/xmingw/local/lib/
asprintf.lib
atk-1.0.lib
charset.lib
fontconfig.def
fontconfig.lib
freetype.def
gdk-win32-2.0.def
gdk-win32-2.0.lib
gdk_pixbuf-2.0.def
gdk_pixbuf-2.0.lib
gettextpo.lib
glib-2.0
glib-2.0.def
glib-2.0.lib
gmodule-2.0.def
gmodule-2.0.lib
gobject-2.0.def
gobject-2.0.lib
gthread-2.0.def
gthread-2.0.lib
gtk-2.0
gtk-win32-2.0.def
gtk-win32-2.0.lib
iconv.lib
intl.lib
jpeg62.def
libatk-1.0.dll.a
libfontconfig.dll.a
libfreetype-bcc.lib
libfreetype.a
libfreetype.dll.a
libfreetype.lib
libgdk-win32-2.0.dll.a
libgdk_pixbuf-2.0.dll.a
libglib-2.0.dll.a
libgmodule-2.0.dll.a
libgobject-2.0.dll.a
libgthread-2.0.dll.a
libgtk-win32-2.0.dll.a
libiconv.a
libintl.a
libjpeg-bcc.lib
libjpeg.a
libjpeg.dll.a
libjpeg.lib
libpango-1.0.dll.a
libpangoft2-1.0.dll.a
libpangowin32-1.0.dll.a
libpng.a
libpng.dll.a
libpng.lib
libpng13.a
libpng13.dll.a
libregex.a
libtiff-bcc.lib
libtiff.a
libtiff.dll.a
libtiff.lib
libtiff3.def
libz-bcc.lib
libz.a
libz.dll.a
libz.lib
pango-1.0.def
pango-1.0.lib
pangoft2-1.0.def
pangoft2-1.0.lib
pangowin32-1.0.def
pangowin32-1.0.lib
pkgconfig
zlib-bcc.lib
zlib.def
zlib.lib
As gtk-gnutella has a dependency on regex. Grab regex from
ftp://ftp.gnu.org/gnu/regex
extract it and compile it as follows:
$ PATH=/opt/xmingw/bin:$PATH \
CC=i386-mingw32msvc-gcc \
./configure \
--host=i386-mingw32msvc \
--prefix=/usr/local/
$ PATH=/opt/xmingw/bin:$PATH \
make -k
ignore any build errors regarding tex like:
"make[1]: tex: Command not found"
and last, build a library:
$ /opt/xmingw/i386-mingw32msvc/bin/ar ru libregex.a regex.o
Now copy libregex.a to /opt/xmingw/local/lib and copy regex.h to
/opt/xmingw/local/include:
$ cp libregex.a /opt/xmingw/local/lib
$ cp regex.h /opt/xmingw/local/include
Compiling gtk-gnutella
As Configure currently doesn't handle cross-compiling very well, there is a
template config.sh available, named config.sh.xmingw. Copy the
config.sh.xmingw as being the correct config.sh:
$ cp config.sh.xmingw config.sh
Remember, the config.sh assumes the layout in /opt/xmingw and
/opt/xmingw/local as described above. Next tell Configure to read the
config.sh and recreate the makefiles:
$ ./Configure -S && make depend
The final step is of course to build gtk-gnutella:
$ export PATH=/opt/xmingw/bin:$PATH
$ make
I was unsuccessful with the win32 packages, that's why I choose to
cross-compile the package myself. First we need to compile the package:
$ PATH=/opt/xmingw/bin:$PATH \
LDFLAGS=-L/opt/xmingw/local/lib \
CPPFLAGS=-I/opt/xmingw/local/include \
./configure \
--host=i386-mingw32msvc \
--target=i386-mingw32msvc \
--without-python \
--without-readline \
--prefix=/opt/xmingw/local/
What we are doing here is set the PATH to start with the xmingw binary
directory. This is where the cross-compiler lives and must be found. As I took
the non-standard route to place my own packages in /opt/xmingw/local I needed
to setup the LDFLAGS and CPPFLAGS to point them in the right direction.
--host and --target tell configure for which host we are going to build. Note
that we are _not_ using the --build flag, as we are building on the machine
which configure can detect itself. Neither do we use python, nor readline.
$ PATH=/opt/xmingw/bin:$PATH make
$ PATH=/opt/xmingw/bin:$PATH make install
/* Author: Jeroen Asselman */
/* Last-Edited: $Id$ */
/*i vi: set tw=78: */