]> git.saurik.com Git - wxWidgets.git/blame_incremental - BuildCVS.txt
Added test for vsscanf. GUESSING IS EVIL! Cannot test, my autoconf is too old.
[wxWidgets.git] / BuildCVS.txt
... / ...
CommitLineData
1------------------------------------------------------------------------
2 How to build the sources from CVS
3------------------------------------------------------------------------
4
5I) Windows using plain makefiles
6----------------------------------------
7
8No idea, never did it.
9
10
11II) Unix using plain makefiles.
12----------------------------------------
13
14Set WXWIN environment variable to the base directory such
15as ~/wxWindows
16
17-> type: export WXWIN=~/wxWindows
18
19Edit ~/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
25III) Windows using configure
26----------------------------------------
27
28No idea.., but take a look at Unix->Windows cross compiling. With minor
29modifications, this should work in Windows if you've got the cygnus
30utilities (bash, GNU make, etc) and either mingw32 or cygwin32 installed.
31See http://www.cygnus.com for these programs.
32
33IV) Unix using configure
34----------------------------------------
35
36a) You have all the newest and greatest GNU tools installed on your system
37and in the same directory hierachy (e.g. either all tools in /usr or all
38in /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)
42and 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
49b) 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
54a+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
61or type: ../configure --with-motif
62or type: ../configure --with-wine
63-> type make
64-> drink lots of coffee and go shopping
65
66
67V) MacOS
68----------------------------------------
69
70VI) OS/2
71----------------------------------------
72
73VII) Unix->Windows cross-compiling using configure
74--------------------------------------------------
75
76First you'll need a cross-compiler; linux glibc binaries of mingw32 and
77cygwin32 (both based on egcs) can be found at
78ftp://ftp.objsw.com/pub/crossgcc/linux-x-win32. Otherwise you can
79compile one yourself. Check the relevant FAQs.
80
81[ A Note about cygwin32 and mingw32: the main difference is that cygwin32
82binaries are always linked against cygwin.dll. This dll encapsulates most
83standard Unix C extensions, which is very handy if you're porting unix
84software to windows. However, wxMSW doesn't need this, so mingw32 is
85preferable if you write portable C(++). ]
86
87You might want to build both Unix and Windows binaries in the same source
88tree; to do this make subdirs for each e.g. unix and win32. If you've
89already build wxWindows in the main dir, do a 'make distclean' there,
90otherwise configure will get confused. (In any case, read the section 'Unix
91using configure' and make sure you're able to build a native wxWindows
92library; cross-compiling errors can be pretty obscure and you'll want to be
93sure that your configure setup is basically sound.)
94
95To 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
103The important thing to notice here is that we suply configure with the names
104of all the non-default binutils (make sure they're in the PATH!), and that
105we tell configure to build for the host platform i586-mingw32.
106Drag'n'drop is disabled because mingw32 lacks (AFAIK) OLE headers.
107
108Configure will conclude that shared libraries are out of the question and
109opt for a static one. I haven't looked into DLL creation yet.
110
111When configure is finished, examine setup.h in the win32 directory. Search for
112wxUSE_DYNLIB_CLASS, it will be defined twice. Remove the second define (0).
113If your cross-compiler is egcs-based, you might want to add #define __EGCS__
114in setup.h (only used by common/timercmn.cpp).
115
116Type
117-> make -C src
118and wait, wait, wait. Don't leave the room, because the minute you do there
119will be a compile error :-)
120
121If this is successful, try building the minimal sample:
122-> cd samples/minimal
123-> make
124-> mv minimal minimal.exe
125
126and run it with wine, for example
127-> wine minimal.exe
128
129If all is well, do an install; from win32
130-> make install
131
132Native and cross-compiled installations can co-exist peacefully
133(as long as their widget sets differ), except for wx-config. You might
134want to rename the cross-compiled one to i586-mingw32-wx-config, or something.
135
136Cross-compiling TODO:
137---------------------
138- resource compiling must be done manually for now (should/can we link the
139default 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.