1 ------------------------------------------------------------------------
2 How to build the sources from CVS
3 ------------------------------------------------------------------------
5 I) Windows using plain makefiles
6 ----------------------------------------
8 a) If using Microsoft Visual C++ 5.0 or 6.0
10 Ensure that the command-line compiler and tools (including
11 nmake) are installed and ready to run. Depending on your
12 installation there may be a batch file (named something like
13 VCVARS32.BAT) that needs to be run to set correct environment
14 varaibles and PATH entries.
16 Continue with item c) below.
19 b) If using the GNU MinGW32 or GNU CygWin32 compilers
21 You'll need the compiler itself which is available from
25 When using MingW32 you'll need GNU make which is a part
26 of the CygWin32 toolchain and is also available as a stand
27 alone port without the infamous Cygwin.dll from
29 http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32
31 The makefile has small problems with Cygwin´s tools
32 so it is recommended not to use these (but MingGW32
35 -> Set your path so that it includes the directory
36 where your compiler and tools reside
38 b-2) Using Mingw32 with gcc-2.95 and Anders Norlander's
41 Using the newer gcc-2.95/Noralander header combination
42 will allow you to compile more of the MSW code, such
43 as OLE and Drag-n-Drop.
45 Instructions are similar to those for Regular Mingw32 except
47 ->Get the compiler from
48 ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/gcc-2.95/
50 ->patch the gcc headers with info in wxWin\Mingw32-gcc295.patches.
51 PLEASE APPLY THESE PATCHES BY HAND! There are apparently a few
52 different versions of the headers floating around.
54 ->copy wxWin\src\makeg295.env to wxWin\src\makeg95.env
59 -> Assumming that you installed the wxWindows sources
61 -> Copy c:\wxWin\include\wx\msw\setup0.h
62 to c:\wxWin\include\wx\msw\setup.h
63 -> Edit c:\wxWin\include\wx\msw\setup.h so that
64 most features are enabled (i.e. defined to 1) with
66 #define wxUSE_SOCKETS 0
68 #define wxUSE_THREADS 1
69 #define wxUSE_FS_INET 0
70 #define wxUSE_FS_ZIP 1
71 #define wxUSE_BUSYINFO 1
72 #define wxUSE_DYNLIB_CLASS 1
73 #define wxUSE_ZIPSTREAM 1
74 #define wxUSE_LIBJPEG 1
75 #define wxUSE_LIBPNG 1
77 and iostreams ares disabled with
78 #define wxUSE_STD_IOSTREAM 0
80 note: ODBC and SOCKETS can be 1 for gcc-2.95
82 -> type: cd c:\wxWin\src\msw
83 -> type: make -f makefile.g95 (if using GNU tools)
84 or type: make -f makefile.g295 (if using Mingw32/gcc-2.95)
85 or type: make -f makefile.vc (if using MS VC++)
91 Building wxGTK or wxMotif completely without configure
92 won't ever work, but there is now a new makefile system
93 that works without libtool and automake, using only
94 configure to create what is needed.
96 In order to create configure, you need to have the
97 GNU autoconf package (version 2.13 or 2.14) installed
98 on your system and type run "autoconf" in the base
99 directory (or run the autogen.sh script in the same
100 directory, which just calls autoconf).
102 Set WXWIN environment variable to the base directory such
103 as ~/wxWindows (this is actually not really needed).
105 -> type: export WXWIN=~/wxWindows
108 -> type: ../configure --with-motif
109 or type: ../configure --with-gtk
111 -> type: su <type root password>
112 -> type: make install
116 Call configure with --disable-shared to create a static
117 library. Calling "make uninstall" will remove the installed
118 library and "make dist" will create a distribution (not
121 III) Windows using configure
122 ----------------------------------------
124 Take a look at Unix->Windows cross compiling. With minor
125 modifications, this should work in Windows if you've got the cygnus
126 utilities (bash, GNU make, etc) and either mingw32 or cygwin32 installed.
127 See http://www.cygnus.com for these programs, or go straight to their
128 ftp server at ftp://sourceware.cygnus.com/pub/cygwin/.
130 Of course, you can also build the library using plain makefiles (see
134 ----------------------------------------
137 ----------------------------------------
139 VII) Unix->Windows cross-compiling using configure
140 --------------------------------------------------
142 First you'll need a cross-compiler; linux glibc binaries of mingw32 and
143 cygwin32 (both based on egcs) can be found at
144 ftp://ftp.objsw.com/pub/crossgcc/linux-x-win32. Otherwise you can
145 compile one yourself. Check the relevant FAQs.
147 [ A Note about cygwin32 and mingw32: the main difference is that cygwin32
148 binaries are always linked against cygwin.dll. This dll encapsulates most
149 standard Unix C extensions, which is very handy if you're porting unix
150 software to windows. However, wxMSW doesn't need this, so mingw32 is
151 preferable if you write portable C(++). ]
153 You might want to build both Unix and Windows binaries in the same source
154 tree; to do this make subdirs for each e.g. unix and win32. If you've
155 already build wxWindows in the main dir, do a 'make distclean' there,
156 otherwise configure will get confused. (In any case, read the section 'Unix
157 using configure' and make sure you're able to build a native wxWindows
158 library; cross-compiling errors can be pretty obscure and you'll want to be
159 sure that your configure setup is basically sound.)
161 To cross compile the windows library, do
163 (or whatever you called it)
164 Now run configure. There are two ways to do this
165 -> ../configure --host=i586-mingw32 --build=i586-linux --with-mingw \
166 --enable-dnd=no --without-odbc
167 where --build= should read whatever platform you're building on. Configure
168 will notice that build and host platforms differ, and automatically prepend
169 i586-mingw32- to gcc, ar, ld, etc (make sure they're in the PATH!).
170 The other way to run configure is by specifying the names of the binaries
172 -> CC=i586-mingw32-gcc CXX=i586-mingw32-g++ RANLIB=i586-mingw32-ranlib \
173 DLLTOOL=i586-mingw32-dlltool LD=i586-mingw32-ld NM=i586-mingw32-nm \
174 ../configure --host=i586-mingw32 --with-mingw --enable-dnd=no
176 (all assuming you're using mingw32)
177 Drag'n'drop is disabled because mingw32 lacks (AFAIK) OLE headers.
179 [ Update: some new mingw32 versions now have a new set of windows header
180 files, which apparently can handle ole. Untested at the moment ]
182 ODBC files don't compile as of 13.10.99 - may be this will be fixed by the
183 moment you're reading these lines.
185 Configure will conclude that shared libraries are out of the question and
186 opt for a static one. I haven't looked into DLL creation yet.
190 and wait, wait, wait. Don't leave the room, because the minute you do there
191 will be a compile error :-)
193 NB: you risk to get quite a few warnings about "ANSI C++ forbids implicit
194 conversion from 'void *'" in all places where va_arg macro is used. This
195 is due to a bug in (some versions of) mingw32 headers which may be
196 corrected by editing the file
198 ${install_prefix}/lib/gcc-lib/i586-mingw32/egcs-2.91.57/include/stdarg.h
200 (instead of egcs-2.91.57 you may have something different), searching for
203 /* Define __gnuc_va_list. */
205 #ifndef __GNUC_VA_LIST
206 #define __GNUC_VA_LIST
207 #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) || defined(__NetBSD__)
208 typedef char *__gnuc_va_list;
210 typedef void *__gnuc_va_list;
214 and adding "|| defined(_WIN32)" to the list of platforms on which
215 __gnuc_va_list is char *.
217 If this is successful, you end up with a libwx_msw.a in win32/lib. Now try
218 building the minimal sample:
220 -> cd samples/minimal
223 and run it with wine, for example (or copy to a Windows box)
226 If all is well, do an install; from win32
229 Native and cross-compiled installations can co-exist peacefully
230 (as long as their widget sets differ), except for wx-config. You might
231 want to rename the cross-compiled one to i586-mingw32-wx-config, or something.
233 Cross-compiling TODO:
234 ---------------------
235 - resource compiling must be done manually for now (should/can we link the
236 default wx resources into libwx_msw.a?) [ No we can't; the linker won't
237 link it in... you have to supply an object file ]
239 - static executables are HUGE -- there must be room for improvement.