]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/osx/install.txt
Minor corrections to wxFlexGridSizer ctor documentation.
[wxWidgets.git] / docs / osx / install.txt
... / ...
CommitLineData
1wxWidgets for Mac installation
2------------------------------
3
4On MacOS X, you can download Apple's free developer tools (gcc
5and associated headers and libraries, such as the Carbon API).
6You can then use configure in a similar way to compiling
7wxWidgets on Linux (or on Windows using MinGW or Cygwin). See
8'Apple Developer Tools' below for more details on using
9configure.
10
11
12Apple Developer Tools: command line
13-----------------------------------
14
15As in all Unix projects, you need to do something like this under MacOS X
16with the Apple Developer Tools installed:
17
181) cd into the base dir
192) mkdir osx-build
203) cd osx-build
214) ../configure (add --with-osx_cocoa for the Cocoa port)
225) make
23
24If you want to install the library into the system directories you'll need
25to do this as root. The accepted way of running commands as root is to
26use the built-in sudo mechanism. First of all, you must be using an
27account marked as a "Computer Administrator". Then
28
296) sudo make install
307) type <YOUR OWN PASSWORD>
31
32Note that while using this method is okay for development, it is not
33recommended that you require endusers to install wxWidgets into their
34system directories in order to use your program. One way to avoid this
35is to configure wxWidgets with --disable-shared. Another way to avoid
36it is to make a framework for wxWidgets. Making frameworks is beyond
37the scope of this document.
38
39Note:
40We recommend you configure a static library instead:
41
424) ../configure --disable-shared
43
44or activate OpenGL:
45
464) ../configure --with-opengl
47
48Note:
49It is rarely desirable to install non-Apple software into system directories.
50By configuring the library with --disable-shared and using the full path
51to wx-config with the --in-place option you can avoid installing the library.
52
53
54Apple Developer Tools: Xcode
55----------------------------
56
57You can use the project in src/wxWindows.xcodeproj to build wxWidgets,
58and there is a sample project supplied with the minimal sample.
59
60Notice that the command line build above builds not just the library itself but
61also wxrc tool which doesn't have its own Xcode project. If you need this tool,
62the simplest possibility is to build it from the command line after installing
63the libraries using commands like this:
64
65$ cd utils/wxrc
66$ g++ -o wxrc wxrc.cpp `wx-config --cxxflags --libs base,xml`
67
68Creating universal binaries
69---------------------------
70
71The Xcode projects for the wxWidgets library and minimal project are set up
72to create universal binaries.
73
74If using the Apple command line tools, pass --enable-universal_binary when
75configuring wxWidgets. If you use wx-config --libs to link your application,
76he necessary linker flags will be added. When compiling your own files,
77you need to add -arch ppc -arch i386 to your CFLAGS.
78
79As an alternative to using --enable-universal_binary, you can build for
80each architecture separately and then use the lipo tool to glue the
81binaries together. Assuming building on a PPC system:
82
831. First build in the usual way to get the PPC library.
84
852. Then, build for Intel, in a different folder. This time use:
86
87export CFLAGS="-g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386"
88export LDFLAGS="-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"
89
90./configure --disable-dependency-tracking --enable-static=yes --enable-shared=no \
91 --target=i386-apple-darwin8 --host=powerpc-apple-darwin8 --build=i386-apple-darwin8
92
93You will need to reverse the powerpc and i386 parameters everywhere to build PPC on an Intel
94machine.
95
963. Use lipo to glue the binaries together.
97
98See also:
99http://developer.apple.com/technotes/tn2005/tn2137.html
100
101