]> git.sesse.net Git - vlc/blob - doc/win32/Cross-Compile-Howto.txt
Fortune
[vlc] / doc / win32 / Cross-Compile-Howto.txt
1                       2002/03/05
2
3         VLC for Windows Cross-Compile HOWTO - 0.1
4
5 *EASY* VLC cross-compilation using Linux for a Windows client
6
7 Bill Eldridge & Gildas Bazin
8
9 0) MSYS & mingw
10 1) Download software packages
11 2) Unpack sources
12 3) Configure vlc
13 4) Make
14 5) Package for Windows
15 6) Further resources
16
17 0) MSYS & mingw
18
19 As of version 1.0.5, the MSYS part of MingW has
20 released an environment that will let you configure
21 and compile packages for mingw directly on Windows.
22
23         http://mingw.sourceforge.net
24
25 Combined with the SDL & GTK development packages,
26 this is enough to compile vlc without cross-compiling
27 on Linux.  However, for those of us who like Linux
28 and want to cross-compile (say to automate nightly
29 builds), read on.
30
31 1) Download software packages
32
33 Download all the software needed to /usr/local/src/VLC -
34 including pre-compiled mingw32 cross-compiler for linux,
35 SDL, gtk, directx, and of course vlc.  You will also need
36 various run-time DLLs on your Windows machine when you go
37 to run the program.
38
39 Go to http://www.videolan.org/vlc/windows.html and download:
40 - mingw32 cross-compiler for linux: linux-cross-mingw32-10022002.tar.bz2
41 - SDL-devel-1.2.3-mingw32.tar.gz (you can also go to www.libsdl.org)
42 - gtk-win32-10022002.tar.bz2 development files.
43 - the directx 7 headers. (Instead of downloading the whole directx SDK
44 form Microsoft)
45
46 Get vlc from:
47
48         http://www.videolan.org/pub/videolan/vlc/snapshots/
49
50 (who needs a release version? you're compiling, after all :)
51 or grab the cvs at:
52
53         http://developers.videolan.org/cvs.html
54
55 using the command:
56
57 cvs -d :pserver:anonymous@anoncvs.videolan.org:/var/cvs/videolan -z3 co
58 vlc
59
60 (and no, you don't need to log in, that's why it's "anonymous")
61
62 2) Unpack sources
63
64 Unpack all your sources to the right place:
65
66 [Note that you can put SDL & gtk in a different place,
67 but then you'll have to edit the sdl-config & gtk-config.
68 directx can go anywhere - you'll just set that path when
69 you do vlc's configure]
70
71 cd to your Source directory
72
73 SRCDIR=`pwd`    # /usr/local/src/VLC seems good, no?
74
75 tar -jxvf linux-cross-mingw32-10022002.tar.bz2 -C /usr/local
76
77 tar -zxf SDL-devel-1.2.3-mingw32.tar.gz -C /usr/local/cross-tools
78 cd /usr/local/cross-tools
79 ln -s i586-mingw32msvc i386-mingw32msvc
80 tar -xf SDL-1.2.3/i386-mingw32msvc.tgz
81 rm -rf SDL-1.2.3
82
83 cd $SRCDIR
84 tar xjvf gtk-win32-10022002.tar.bz2 -C /usr/local
85
86 mkdir /usr/local/directx
87 unzip -d /usr/local/directx/include dxheaders.zip
88
89 tar -jxf <vlc-snapshot-xxx>.bz2 # Unless you used cvs
90 cd vlc
91
92 3) Configure vlc
93
94 rm config.cache config.status
95 make clean      # or "make distclean" for pretty pretty
96
97 PATH=/usr/local/cross-tools/bin:$PATH \
98 CC=i586-mingw32msvc-gcc \
99 ./configure --host=i586-mingw32msvc \
100   --target=i586-mingw32msvc --build=i386-linux \
101   --with-directx=/usr/local/directx \
102   --with-gtk-config-path=/usr/local/gtk-win32/bin \
103   --with-sdl-config-path=/usr/local/cross-tools/i586-mingw32msvc/bin
104
105 4) make vlc
106
107 PATH=/usr/local/cross-tools/bin:$PATH \
108 make
109
110 5) Package for Windows
111
112 mkdir /usr/local/src/winvlc
113 mkdir /usr/local/src/winvlc/plugins
114 mkdir /usr/local/src/winvlc/share
115 cp vlc.exe /usr/local/src/winvlc/
116 cp plugins/*.so /usr/local/src/winvlc/plugins/
117 cp share/*.psf /usr/local/src/winvlc/share/
118 cd /usr/local/src
119 strip winvlc/vlc.exe winvlc/plugins/*.so
120 zip -r winvlc.zip winvlc
121
122 Now place winvlc in your ftp/html downloads,
123 or copy to your dos disk or move to a floppy
124 (only about 270K)
125
126 Uncompress to C:\winvlc
127
128 Don't forget to place all the GTK and SDL dll's from the development packages
129 you downloaded on http://www.videolan.org/vlc/windows.html in c:\winvlc
130
131 cd c:\winvlc
132 vlc -v
133
134 Note: -v gives you errors in case something's not being found,
135 otherwise not needed.
136
137
138 6) Further resources (for this or other cross-compilation
139 projects):
140
141 At this time, mingw32_2.95.3.7-3_i386.deb and
142 mingw32-runtime_1.2-1_i386.deb were at:
143
144 http://packages.debian.org/testing/devel/mingw32.html
145 http://packages.debian.org/testing/devel/mingw32-runtime.html
146
147 and possibly on your CD - you might be able to find later
148 versions, or save bandwidth, if you care.  (Of course we'll
149 only be testing what we put on the VideoLan website).
150 While these are "Debian" packages, they work on Redhat
151 and possibly elsewhere - download dpkg for your system
152 and do something like:
153
154 dpkg -x  mingw32_2.95.3.7-3_i386.deb /tmp/ming
155 dpkg -x  mingw32-runtime_1.2-1_i386.deb /tmp/ming
156 mv /tmp/ming/usr /usr/local/cross-tools
157
158
159 Full DX-7 headers, libs & directx.h (the Peter Puck version)
160 can be found at:
161
162         http://fceultra.sourceforge.net/dev
163
164 There are other versions of GTK for Windows available, but
165 the one provided here has been hacked specifically for VideoLan.