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