]> git.saurik.com Git - wxWidgets.git/blob - BuildCVS.txt
0622a9dfc1a40c2ec47152543d579fc2469c14ce
[wxWidgets.git] / BuildCVS.txt
1 ------------------------------------------------------------------------
2 How to build the sources from CVS
3 ------------------------------------------------------------------------
4
5 I) Windows using plain makefiles
6 ----------------------------------------
7
8 No idea, never did it.
9
10
11 II) Unix using plain makefiles.
12 ----------------------------------------
13
14 Set WXWIN environment variable to the base directory such
15 as ~/wxWindows
16
17 -> type: export WXWIN=~/wxWindows
18
19 Edit ~/wxWindows/src/make.env as you wish.
20 -> type: cd ~/wxWindows/src/gtk
21 -> type: cp ./setup0.h setup.h
22 -> type: make -f makefile.unx gtk
23 -> pray
24
25 III) Windows using configure
26 ----------------------------------------
27
28 No idea.., but take a look at Unix->Windows cross compiling. With minor
29 modifications, this should work in Windows if you've got the cygnus
30 utilities (bash, GNU make, etc) and either mingw32 or cygwin32 installed.
31 See http://www.cygnus.com for these programs.
32
33 IV) Unix using configure
34 ----------------------------------------
35
36 a) You have all the newest and greatest GNU tools installed on your system
37 and in the same directory hierachy (e.g. either all tools in /usr or all
38 in /usr/local), these tools are:
39 - GNU libtool 1.2e (1.3 doesn't work here)
40 - GNU autoconf 2.13 (including autoheader 2.13)
41 - GNU automake 1.4 (including aclocal 1.4)
42 and possibly but not forcibly
43 - GNU make 3.76.1
44 - GNU C++ (EGCS)
45
46 -> Go to the base directory
47 -> type: ./autogen.sh
48
49 b) You don't know what autos are and have no driver's licence anyway:
50
51 -> Go to the testconf directory
52 -> type: ./apply
53
54 a+b) Then proceed in either case with:
55
56 -> Choose a directory name that seems fit for building wxWindows, e.g. mybuild
57 -> Go the base directory
58 -> type: mkdir mybuild
59 -> type: cd mybuild
60 -> type: ../configure --with-gtk
61 or type: ../configure --with-motif
62 or type: ../configure --with-wine
63 -> type make
64 -> drink lots of coffee and go shopping
65
66
67 V) MacOS
68 ----------------------------------------
69
70 VI) OS/2
71 ----------------------------------------
72
73 VII) Unix->Windows cross-compiling using configure
74 --------------------------------------------------
75
76 First you'll need a cross-compiler; linux glibc binaries of mingw32 and
77 cygwin32 (both based on egcs) can be found at
78 ftp://ftp.objsw.com/pub/crossgcc/linux-x-win32. Otherwise you can
79 compile one yourself. Check the relevant FAQs.
80
81 [ A Note about cygwin32 and mingw32: the main difference is that cygwin32
82 binaries are always linked against cygwin.dll. This dll encapsulates most
83 standard Unix C extensions, which is very handy if you're porting unix
84 software to windows. However, wxMSW doesn't need this, so mingw32 is
85 preferable if you write portable C(++). ]
86
87 You might want to build both Unix and Windows binaries in the same source
88 tree; to do this make subdirs for each e.g. unix and win32. If you've
89 already build wxWindows in the main dir, do a 'make distclean' there,
90 otherwise configure will get confused. (In any case, read the section 'Unix
91 using configure' and make sure you're able to build a native wxWindows
92 library; cross-compiling errors can be pretty obscure and you'll want to be
93 sure that your configure setup is basically sound.)
94
95 To cross compile the windows library, do
96 -> cd win32
97 -> CC=i586-mingw32-gcc CXX=i586-mingw32-g++ RANLIB=i586-mingw32-ranlib \
98 DLLTOOL=i586-mingw32-dlltool LD=i586-mingw32-ld NM=i586-mingw32-nm \
99 ../configure --host=i586-mingw32 --with-mingw --enable-dnd=no
100
101 (assuming you're using mingw32)
102
103 The important thing to notice here is that we suply configure with the names
104 of all the non-default binutils (make sure they're in the PATH!), and that
105 we tell configure to build for the host platform i586-mingw32.
106 Drag'n'drop is disabled because mingw32 lacks (AFAIK) OLE headers.
107
108 Configure will conclude that shared libraries are out of the question and
109 opt for a static one. I haven't looked into DLL creation yet.
110
111 When configure is finished, examine setup.h in the win32 directory. Search for
112 wxUSE_DYNLIB_CLASS, it will be defined twice. Remove the second define (0).
113 If your cross-compiler is egcs-based, you might want to add #define __EGCS__
114 in setup.h (only used by common/timercmn.cpp).
115
116 Type
117 -> make -C src
118 and wait, wait, wait. Don't leave the room, because the minute you do there
119 will be a compile error :-)
120
121 If this is successful, try building the minimal sample:
122 -> cd samples/minimal
123 -> make
124 -> mv minimal minimal.exe
125
126 and run it with wine, for example
127 -> wine minimal.exe
128
129 If all is well, do an install; from win32
130 -> make install
131
132 Native and cross-compiled installations can co-exist peacefully
133 (as long as their widget sets differ), except for wx-config. You might
134 want to rename the cross-compiled one to i586-mingw32-wx-config, or something.
135
136 Cross-compiling TODO:
137 ---------------------
138 - resource compiling must be done manually for now (should/can we link the
139 default wx resources into libwx_msw.a?)
140 - dynamic libraries
141 - static executables are HUGE -- there must be room for improvement.
142 - wxUSE_DYNLIB_CLASS double def is probably a bug in configure.in
143 - figure out a clean way to determine we're building with configure
144 - possibly some problems with parser.y and lexer.c and the like.