]> git.saurik.com Git - wxWidgets.git/blame - BuildCVS.txt
compilation fixes for wxGTK
[wxWidgets.git] / BuildCVS.txt
CommitLineData
f6577bba
RR
1------------------------------------------------------------------------
2 How to build the sources from CVS
3------------------------------------------------------------------------
4
f2854a24
JS
5Please use the install.txt files in docs/gtk, docs/msw, docs/motif, docs/mac
6etc. alongside these instructions.
7
f6577bba
RR
8I) Windows using plain makefiles
9----------------------------------------
10
a353a0be
RD
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 (named something like
16VCVARS32.BAT) that needs to be run to set correct environment
17varaibles and PATH entries.
18
19Continue with item c) below.
20
21
f6bcfd97 22b) If using the GNU Mingw32 or GNU Cygwin32 compilers
f6577bba 23
f6bcfd97 24You can get Mingw32 from http://www.mingw.org
2662e49e 25
f6bcfd97 26Cygwin32 is available at http://www.cygwin.com
2662e49e 27
f6bcfd97
BP
28The makefile might have small problems with Cygwin's tools
29so it is recommended to use Mingw32 and its toolchain instead
30if possible.
c45a644e 31
2662e49e
RR
32-> Set your path so that it includes the directory
33 where your compiler and tools reside
a353a0be 34
f6bcfd97
BP
35-> If your are using an old Mingw32 version (gcc-2.95 or older),
36 you might need to fix some headers with the patches contained
37 in the wxWin\Mingw32-gcc295.patches file. PLEASE APPLY THESE
38 PATCHES BY HAND! There are apparently a few different versions
39 of the headers floating around. Note that these patches are
40 not needed if you are using Mingw32 gcc-2.95.2 or newer.
41
42-> Edit wx/src/makeg95.env and set the MINGW32 variable at the top of
43 the file to either 1 (you have Mingw32) or 0 (you have Cygwin32).
44 If using MINGW32, also set the MINGW32VERSION variable
45 appropiately.
d66d3ce6 46
ce1a1ff4 47
a353a0be
RD
48c) Build instructions
49
50-> Assumming that you installed the wxWindows sources
2662e49e 51 into c:\wxWin
a353a0be 52-> Copy c:\wxWin\include\wx\msw\setup0.h
2662e49e
RR
53 to c:\wxWin\include\wx\msw\setup.h
54-> Edit c:\wxWin\include\wx\msw\setup.h so that
f6bcfd97 55 most features are enabled (i.e. defined to 1), for example:
ce1a1ff4 56 #define wxUSE_ODBC 0
f6bcfd97 57 #define wxUSE_SOCKETS 1
f56b8330 58 #define wxUSE_HTML 1
2662e49e 59 #define wxUSE_THREADS 1
c45a644e 60 #define wxUSE_FS_INET 0
f56b8330 61 #define wxUSE_FS_ZIP 1
2662e49e
RR
62 #define wxUSE_BUSYINFO 1
63 #define wxUSE_DYNLIB_CLASS 1
64 #define wxUSE_ZIPSTREAM 1
48b1d0ff
RR
65 #define wxUSE_LIBJPEG 1
66 #define wxUSE_LIBPNG 1
2662e49e 67
f6bcfd97 68 and std iostreams are disabled with
2662e49e 69 #define wxUSE_STD_IOSTREAM 0
f6bcfd97 70
2662e49e 71-> type: cd c:\wxWin\src\msw
d66d3ce6 72-> type: make -f makefile.g95 (if using GNU tools)
f6bcfd97 73or type: nmake -f makefile.vc (if using MS VC++)
a353a0be 74
f6577bba 75
583a6578
RR
76II) Unix ports
77--------------
8e877c19
RR
78
79Building wxGTK or wxMotif completely without configure
80won't ever work, but there is now a new makefile system
81that works without libtool and automake, using only
a353a0be
RD
82configure to create what is needed.
83
84In order to create configure, you need to have the
85GNU autoconf package (version 2.13 or 2.14) installed
86on your system and type run "autoconf" in the base
87directory (or run the autogen.sh script in the same
88directory, which just calls autoconf).
f6577bba 89
a533f5c1 90Set WXWIN environment variable to the base directory such
8e877c19 91as ~/wxWindows (this is actually not really needed).
a533f5c1
RR
92
93-> type: export WXWIN=~/wxWindows
8e877c19
RR
94-> type: md mybuild
95-> type: cd mybuild
96-> type: ../configure --with-motif
97or type: ../configure --with-gtk
583a6578
RR
98-> type: make
99-> type: su <type root password>
100-> type: make install
101-> type: ldconfig
102-> type: exit
f6577bba 103
a4aad961
RR
104Call configure with --disable-shared to create a static
105library. Calling "make uninstall" will remove the installed
106library and "make dist" will create a distribution (not
107yet complete).
108
f6577bba
RR
109III) Windows using configure
110----------------------------------------
111
22baaed3 112Take a look at Unix->Windows cross compiling. With minor
0a2fe387 113modifications, this should work in Windows if you've got the cygnus
a353a0be 114utilities (bash, GNU make, etc) and either mingw32 or cygwin32 installed.
22baaed3 115See http://www.cygnus.com for these programs, or go straight to their
a353a0be 116ftp server at ftp://sourceware.cygnus.com/pub/cygwin/.
22baaed3 117
a353a0be 118Of course, you can also build the library using plain makefiles (see
22baaed3 119section I).
f6577bba 120
79199066 121IV) Classic MacOS using CodeWarrior (eg MacOS 8.x/9.x)
f6577bba
RR
122----------------------------------------
123
79199066
GD
124Refer to the readme.txt and install.txt files in docs/mac to build
125wxWindows under Classic Mac OS using CodeWarrior.
126
127If you are checking out the CVS sources using cvs under Mac OS X and
128compiling under Classic Mac OS, make sure that all text files have a
129Mac OS type of 'TEXT' otherwise CodeWarrior may ignore them. Checking
130out the CVS sources using cvs under Mac OS X creates untyped files
131which can lead to compialtion errors under CodeWarrior which are hard
132to track down.
133
134V) MacOS X using configure and the Developer Tools
135----------------------------------------
136
137You need to have the Developer Tools installed. If this is not the case,
138you will need to register at the Apple Developer web site (this is a free
139registration) in order to download the Developer Tools installer.
140
141In order to create configure, you need to have the
142GNU autoconf package (version 2.13 or 2.14) installed
143on your system and type run "autoconf" in the base
144directory (or run the autogen.sh script in the same
145directory, which just calls autoconf).
146
147-> type: mkdir macbuild
148-> type: cd macbuild
149-> type: ../configure --with-mac
150or type: ../configure
151-> type: make
152
0a2fe387 153VI) OS/2
f6577bba
RR
154----------------------------------------
155
0a2fe387
HH
156VII) Unix->Windows cross-compiling using configure
157--------------------------------------------------
158
159First you'll need a cross-compiler; linux glibc binaries of mingw32 and
160cygwin32 (both based on egcs) can be found at
a353a0be 161ftp://ftp.objsw.com/pub/crossgcc/linux-x-win32. Otherwise you can
0a2fe387
HH
162compile one yourself. Check the relevant FAQs.
163
164[ A Note about cygwin32 and mingw32: the main difference is that cygwin32
165binaries are always linked against cygwin.dll. This dll encapsulates most
166standard Unix C extensions, which is very handy if you're porting unix
167software to windows. However, wxMSW doesn't need this, so mingw32 is
168preferable if you write portable C(++). ]
169
170You might want to build both Unix and Windows binaries in the same source
171tree; to do this make subdirs for each e.g. unix and win32. If you've
172already build wxWindows in the main dir, do a 'make distclean' there,
173otherwise configure will get confused. (In any case, read the section 'Unix
174using configure' and make sure you're able to build a native wxWindows
175library; cross-compiling errors can be pretty obscure and you'll want to be
176sure that your configure setup is basically sound.)
177
178To cross compile the windows library, do
a353a0be 179-> cd win32
0d639168 180(or whatever you called it)
214960fb
HH
181Now run configure. There are two ways to do this
182-> ../configure --host=i586-mingw32 --build=i586-linux --with-mingw \
a0c79abb 183 --enable-dnd=no --without-odbc
214960fb
HH
184where --build= should read whatever platform you're building on. Configure
185will notice that build and host platforms differ, and automatically prepend
a353a0be
RD
186i586-mingw32- to gcc, ar, ld, etc (make sure they're in the PATH!).
187The other way to run configure is by specifying the names of the binaries
214960fb 188yourself:
0a2fe387
HH
189-> CC=i586-mingw32-gcc CXX=i586-mingw32-g++ RANLIB=i586-mingw32-ranlib \
190 DLLTOOL=i586-mingw32-dlltool LD=i586-mingw32-ld NM=i586-mingw32-nm \
191 ../configure --host=i586-mingw32 --with-mingw --enable-dnd=no
192
214960fb 193(all assuming you're using mingw32)
0a2fe387
HH
194Drag'n'drop is disabled because mingw32 lacks (AFAIK) OLE headers.
195
a353a0be 196[ Update: some new mingw32 versions now have a new set of windows header
0d639168
HH
197files, which apparently can handle ole. Untested at the moment ]
198
a0c79abb
VZ
199ODBC files don't compile as of 13.10.99 - may be this will be fixed by the
200moment you're reading these lines.
201
0a2fe387
HH
202Configure will conclude that shared libraries are out of the question and
203opt for a static one. I haven't looked into DLL creation yet.
204
a353a0be 205Type
0d639168 206-> make
0a2fe387
HH
207and wait, wait, wait. Don't leave the room, because the minute you do there
208will be a compile error :-)
209
ce1a1ff4
VZ
210NB: you risk to get quite a few warnings about "ANSI C++ forbids implicit
211 conversion from 'void *'" in all places where va_arg macro is used. This
212 is due to a bug in (some versions of) mingw32 headers which may be
213 corrected by editing the file
214
215 ${install_prefix}/lib/gcc-lib/i586-mingw32/egcs-2.91.57/include/stdarg.h
216
217 (instead of egcs-2.91.57 you may have something different), searching for
218 the lines
219
220/* Define __gnuc_va_list. */
221
222#ifndef __GNUC_VA_LIST
223#define __GNUC_VA_LIST
224#if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) || defined(__NetBSD__)
225typedef char *__gnuc_va_list;
226#else
227typedef void *__gnuc_va_list;
228#endif
229#endif
230
231 and adding "|| defined(_WIN32)" to the list of platforms on which
232 __gnuc_va_list is char *.
233
a353a0be 234If this is successful, you end up with a libwx_msw.a in win32/lib. Now try
0d639168
HH
235building the minimal sample:
236
0a2fe387
HH
237-> cd samples/minimal
238-> make
0a2fe387 239
ce1a1ff4 240and run it with wine, for example (or copy to a Windows box)
0a2fe387
HH
241-> wine minimal.exe
242
243If all is well, do an install; from win32
244-> make install
245
a353a0be
RD
246Native and cross-compiled installations can co-exist peacefully
247(as long as their widget sets differ), except for wx-config. You might
0a2fe387 248want to rename the cross-compiled one to i586-mingw32-wx-config, or something.
25a2a4b0
HH
249
250Cross-compiling TODO:
251---------------------
a353a0be 252- resource compiling must be done manually for now (should/can we link the
22baaed3
HH
253default wx resources into libwx_msw.a?) [ No we can't; the linker won't
254link it in... you have to supply an object file ]
25a2a4b0
HH
255- dynamic libraries
256- static executables are HUGE -- there must be room for improvement.
214960fb 257