]> git.saurik.com Git - wxWidgets.git/blame - BuildSVN.txt
Merge wxBitmapButton and wxButton panels in the xrc sample.
[wxWidgets.git] / BuildSVN.txt
CommitLineData
b0f73b67
VZ
1------------------------------------------------------------------------
2 How to build the sources from SVN
3------------------------------------------------------------------------
4
5Please use the install.txt files in docs/gtk, docs/msw, docs/motif, docs/mac
6etc. alongside these instructions.
7
8I) Windows using plain makefiles
9----------------------------------------
10
11a) If using Microsoft Visual C++ 5.0 or 6.0
12
13Ensure that the command-line compiler and tools (including
14nmake) are installed and ready to run. Depending on your
15installation there may be a batch file (commonly named VCVARS32.BAT)
16that needs to be run to set correct environment variables and PATH entries.
17
18Continue with item c) below.
19
20
21b) If using the MinGW or Cygwin compilers
22
23You can get MinGW from http://www.mingw.org/
24
25Cygwin is available at http://www.cygwin.com/
26
27If you are using Cygwin or MinGW together with the MSYS environment, you
28can build the library using configure (see "Unix ports" and
29"Windows using configure" below). You can also
30build wxWidgets without configure using native makefile, but only with
31MinGW. Using Cygwin together with Windows makefile is no longer supported.
32
33If building with MinGW without configure:
34
35-> Set your path so that it includes the directory
36 where your compiler and tools reside
37
38-> Make sure you have GNU Make installed. It must be Windows native version.
39 Download it from http://www.mingw.org, the executable will be called
40 mingw32-make.exe.
41
42-> Modern version of MinGW is required; preferably MinGW 2.0 (with gcc3),
43 but MinGW with gcc-2.95.3 will suffice. If you are using 2.95, you will
44 have to change variable GCC_VERSION in config.gcc (see msw/install.txt
45 for details).
46
47If using configure, Unix instructions apply.
48
49
50c) Build instructions
51
52Assuming that you installed the wxWidgets sources into c:\wxWidgets:
53
54-> Copy c:\wxWidgets\include\wx\msw\setup0.h
55 to c:\wxWidgets\include\wx\msw\setup.h
56-> Edit c:\wxWidgets\include\wx\msw\setup.h to choose
57 the features you would like to compile wxWidgets with[out].
58
59 and std iostreams are disabled with
60 #define wxUSE_STD_IOSTREAM 0
61
62-> type: cd c:\wxWidgets\build\msw
63-> type: make -f makefile.gcc (if using GNU tools)
64or type: nmake -f makefile.vc (if using MS VC++)
65etc.
66
67 See also docs/msw/install.txt for additional compilation options.
68
69d) Borland (including free command line tools)
70 Download tools from http://www.borland.com/downloads/
71
72 See docs/msw/install.txt for details; in brief:
73
74-> type cd c:\wxWidgets\build\msw
75-> type make -f makefile.bcc
76
77You can customize many things in the build process, detailed description is
78in docs/msw/install.txt.
79
80
81II) Unix ports
82--------------
83
84Building wxGTK or wxMotif completely without configure
85won't ever work, but there is now a new makefile system
86that works without libtool and automake, using only
87configure to create what is needed.
88
89In order to create configure, you need to have the
90GNU autoconf package (version > 2.54) installed
91on your system and type run "autoconf" in the base
92directory (or run the autogen.sh script in the same
93directory, which just calls autoconf). Note that you usually don't
94need to do this because configure is included in SVN.
95
96Set WXWIN environment variable to the base directory such
97as ~/wxWidgets (this is actually not really needed).
98
99-> type: export WXWIN=~/wxWidgets
100-> type: md mybuild
101-> type: cd mybuild
102-> type: ../configure --with-motif
103or type: ../configure --with-gtk
104-> type: make
105-> type: su <type root password>
106-> type: make install
107-> type: ldconfig
108-> type: exit
109
110Call configure with --disable-shared to create a static
111library. Calling "make uninstall" will remove the installed
112library and "make dist" will create a distribution (not
113yet complete).
114
115III) Windows using configure
116----------------------------------------
117
118wxWidgets can be built on Windows using MSYS (see
119http://www.mingw.org/), which is a POSIX build environment
120for Windows. With MSYS you can just ./configure && make (see also VII,
121Unix->Windows cross-compiling using configure).
122
123Of course, you can also build the library using plain makefiles (see
124section I).
125
126V) MacOS X using configure and the Developer Tools
127----------------------------------------
128
129You need to have the Developer Tools installed. If this is not the case,
130you will need to register at the Apple Developer web site (this is a free
131registration) in order to download the Developer Tools installer.
132
133In order to create configure, you need to have the
134GNU autoconf package (version >= 2.54) installed
135on your system and type run "autoconf" in the base
136directory (or run the autogen.sh script in the same
137directory, which just calls autoconf).
138
139-> type: mkdir macbuild
140-> type: cd macbuild
141-> type: ../configure --with-mac
142or type: ../configure
143-> type: make
144
145VI) OS/2
146----------------------------------------
147No notes.
148
149VII) Unix->Windows cross-compiling using configure
150--------------------------------------------------
151
152First you'll need a cross-compiler; linux glibc binaries of MinGW and
153Cygwin (both based on egcs) can be found at
154ftp://ftp.objsw.com/pub/crossgcc/linux-x-win32. Alternative binaries,
155based on the latest MinGW release can be found at
156http://members.telering.at/jessich/mingw/mingwcross/mingw_cross.html
157Otherwise you can compile one yourself.
158
159[ A Note about Cygwin and MinGW: the main difference is that Cygwin
160binaries are always linked against cygwin.dll. This dll encapsulates most
161standard Unix C extensions, which is very handy if you're porting unix
162software to windows. However, wxMSW doesn't need this, so MinGW is
163preferable if you write portable C(++). ]
164
165You might want to build both Unix and Windows binaries in the same source
166tree; to do this make subdirs for each e.g. unix and win32. If you've
167already build wxWidgets in the main dir, do a 'make distclean' there,
168otherwise configure will get confused. (In any case, read the section 'Unix
169using configure' and make sure you're able to build a native wxWidgets
170library; cross-compiling errors can be pretty obscure and you'll want to be
171sure that your configure setup is basically sound.)
172
173To cross compile the windows library, do
174-> cd win32
175(or whatever you called it)
176Now run configure. There are two ways to do this
177-> ../configure --host=i586-mingw32 --build=i586-linux --with-mingw
178where --build= should read whatever platform you're building on. Configure
179will notice that build and host platforms differ, and automatically prepend
180i586-mingw32- to gcc, ar, ld, etc (make sure they're in the PATH!).
181The other way to run configure is by specifying the names of the binaries
182yourself:
183-> CC=i586-mingw32-gcc CXX=i586-mingw32-g++ RANLIB=i586-mingw32-ranlib \
184 DLLTOOL=i586-mingw32-dlltool LD=i586-mingw32-ld NM=i586-mingw32-nm \
185 ../configure --host=i586-mingw32 --with-mingw
186
187(all assuming you're using MinGW)
188By default this will compile a DLL, if you want a static library,
189specify --disable-shared.
190
191Type
192-> make
193and wait, wait, wait. Don't leave the room, because the minute you do there
194will be a compile error :-)
195
196NB: if you are using a very old compiler you risk to get quite a few warnings
197 about "ANSI C++ forbids implicit conversion from 'void *'" in all places
198 where va_arg macro is used. This is due to a bug in (some versions of)
199 MinGW headers which may be corrected by upgrading your compier,
200 otherwise you might edit the file
201
202 ${install_prefix}/lib/gcc-lib/i586-mingw32/egcs-2.91.57/include/stdarg.h
203
204 (instead of egcs-2.91.57 you may have something different), searching for
205 the lines
206
207/* Define __gnuc_va_list. */
208
209#ifndef __GNUC_VA_LIST
210#define __GNUC_VA_LIST
211#if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) || defined(__NetBSD__)
212typedef char *__gnuc_va_list;
213#else
214typedef void *__gnuc_va_list;
215#endif
216#endif
217
218 and adding "|| defined(_WIN32)" to the list of platforms on which
219 __gnuc_va_list is char *.
220
221If this is successful, you end up with a wx23_2.dll/libwx23_2.a in win32/lib
222(or just libwx_msw.a if you opted for a static build).
223Now try building the minimal sample:
224
225-> cd samples/minimal
226-> make
227
228and run it with wine, for example (or copy to a Windows box)
229-> wine minimal.exe
230
231If all is well, do an install; from win32
232-> make install
233
234Native and cross-compiled installations can co-exist peacefully
235(as long as their widget sets differ), except for wx-config. You might
236want to rename the cross-compiled one to i586-mingw32-wx-config, or something.
237
238Cross-compiling TODO:
239---------------------
240- resource compiling must be done manually for now (should/can we link the
241default wx resources into libwx_msw.a?) [ No we can't; the linker won't
242link it in... you have to supply an object file ]
243- static executables are HUGE -- there must be room for improvement.
244