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