]> git.saurik.com Git - wxWidgets.git/blob - BuildCVS.txt
Debug version with compiler switch /MDd
[wxWidgets.git] / BuildCVS.txt
1 ------------------------------------------------------------------------
2 How to build the sources from CVS
3 ------------------------------------------------------------------------
4
5 I) Windows using plain makefiles
6 ----------------------------------------
7
8 a) If using Microsoft Visual C++ 5.0 or 6.0
9
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.
15
16 Continue with item c) below.
17
18
19 b) If using the GNU MinGW32 or GNU CygWin32 compilers
20
21 You'll need the compiler itself which is available from
22
23 http://www.cygwin.com
24
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
28
29 http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32
30
31 The makefile has small problems with Cygwin´s tools
32 so it is recommended not to use these (but MingGW32
33 and its make.exe).
34
35 -> Set your path so that it includes the directory
36 where your compiler and tools reside
37
38
39 c) Build instructions
40
41 -> Assumming that you installed the wxWindows sources
42 into c:\wxWin
43 -> Copy c:\wxWin\include\wx\msw\setup0.h
44 to c:\wxWin\include\wx\msw\setup.h
45 -> Edit c:\wxWin\include\wx\msw\setup.h so that
46 most features are enabled (i.e. defined to 1) with
47 #define wxUSE_ODBC 0
48 #define wxUSE_SOCKETS 0
49 #define wxUSE_HTML 1
50 #define wxUSE_THREADS 1
51 #define wxUSE_FS_INET 0
52 #define wxUSE_FS_ZIP 1
53 #define wxUSE_BUSYINFO 1
54 #define wxUSE_DYNLIB_CLASS 1
55 #define wxUSE_ZIPSTREAM 1
56 #define wxUSE_LIBJPEG 1
57 #define wxUSE_LIBPNG 1
58
59 and iostreams ares disabled with
60 #define wxUSE_STD_IOSTREAM 0
61 -> type: cd c:\wxWin\src\msw
62 -> type: make -f makefile.g95 (if using GNU tools)
63 or type: make -f makefile.vc (if using MS VC++)
64
65
66 II) Unix ports
67 --------------
68
69 Building wxGTK or wxMotif completely without configure
70 won't ever work, but there is now a new makefile system
71 that works without libtool and automake, using only
72 configure to create what is needed.
73
74 In order to create configure, you need to have the
75 GNU autoconf package (version 2.13 or 2.14) installed
76 on your system and type run "autoconf" in the base
77 directory (or run the autogen.sh script in the same
78 directory, which just calls autoconf).
79
80 Set WXWIN environment variable to the base directory such
81 as ~/wxWindows (this is actually not really needed).
82
83 -> type: export WXWIN=~/wxWindows
84 -> type: md mybuild
85 -> type: cd mybuild
86 -> type: ../configure --with-motif
87 or type: ../configure --with-gtk
88 -> type: make
89 -> type: su <type root password>
90 -> type: make install
91 -> type: ldconfig
92 -> type: exit
93
94 Call configure with --disable-shared to create a static
95 library. Calling "make uninstall" will remove the installed
96 library and "make dist" will create a distribution (not
97 yet complete).
98
99 III) Windows using configure
100 ----------------------------------------
101
102 Take a look at Unix->Windows cross compiling. With minor
103 modifications, this should work in Windows if you've got the cygnus
104 utilities (bash, GNU make, etc) and either mingw32 or cygwin32 installed.
105 See http://www.cygnus.com for these programs, or go straight to their
106 ftp server at ftp://sourceware.cygnus.com/pub/cygwin/.
107
108 Of course, you can also build the library using plain makefiles (see
109 section I).
110
111 V) MacOS
112 ----------------------------------------
113
114 VI) OS/2
115 ----------------------------------------
116
117 VII) Unix->Windows cross-compiling using configure
118 --------------------------------------------------
119
120 First you'll need a cross-compiler; linux glibc binaries of mingw32 and
121 cygwin32 (both based on egcs) can be found at
122 ftp://ftp.objsw.com/pub/crossgcc/linux-x-win32. Otherwise you can
123 compile one yourself. Check the relevant FAQs.
124
125 [ A Note about cygwin32 and mingw32: the main difference is that cygwin32
126 binaries are always linked against cygwin.dll. This dll encapsulates most
127 standard Unix C extensions, which is very handy if you're porting unix
128 software to windows. However, wxMSW doesn't need this, so mingw32 is
129 preferable if you write portable C(++). ]
130
131 You might want to build both Unix and Windows binaries in the same source
132 tree; to do this make subdirs for each e.g. unix and win32. If you've
133 already build wxWindows in the main dir, do a 'make distclean' there,
134 otherwise configure will get confused. (In any case, read the section 'Unix
135 using configure' and make sure you're able to build a native wxWindows
136 library; cross-compiling errors can be pretty obscure and you'll want to be
137 sure that your configure setup is basically sound.)
138
139 To cross compile the windows library, do
140 -> cd win32
141 (or whatever you called it)
142 Now run configure. There are two ways to do this
143 -> ../configure --host=i586-mingw32 --build=i586-linux --with-mingw \
144 --enable-dnd=no
145 where --build= should read whatever platform you're building on. Configure
146 will notice that build and host platforms differ, and automatically prepend
147 i586-mingw32- to gcc, ar, ld, etc (make sure they're in the PATH!).
148 The other way to run configure is by specifying the names of the binaries
149 yourself:
150 -> CC=i586-mingw32-gcc CXX=i586-mingw32-g++ RANLIB=i586-mingw32-ranlib \
151 DLLTOOL=i586-mingw32-dlltool LD=i586-mingw32-ld NM=i586-mingw32-nm \
152 ../configure --host=i586-mingw32 --with-mingw --enable-dnd=no
153
154 (all assuming you're using mingw32)
155 Drag'n'drop is disabled because mingw32 lacks (AFAIK) OLE headers.
156
157 [ Update: some new mingw32 versions now have a new set of windows header
158 files, which apparently can handle ole. Untested at the moment ]
159
160 Configure will conclude that shared libraries are out of the question and
161 opt for a static one. I haven't looked into DLL creation yet.
162
163 Type
164 -> make
165 and wait, wait, wait. Don't leave the room, because the minute you do there
166 will be a compile error :-)
167
168 If this is successful, you end up with a libwx_msw.a in win32/lib. Now try
169 building the minimal sample:
170
171 -> cd samples/minimal
172 -> make
173 -> mv minimal minimal.exe
174
175 and run it with wine, for example
176 -> wine minimal.exe
177
178 If all is well, do an install; from win32
179 -> make install
180
181 Native and cross-compiled installations can co-exist peacefully
182 (as long as their widget sets differ), except for wx-config. You might
183 want to rename the cross-compiled one to i586-mingw32-wx-config, or something.
184
185 Cross-compiling TODO:
186 ---------------------
187 - resource compiling must be done manually for now (should/can we link the
188 default wx resources into libwx_msw.a?) [ No we can't; the linker won't
189 link it in... you have to supply an object file ]
190 - dynamic libraries
191 - static executables are HUGE -- there must be room for improvement.
192