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