Fix some C++ warnings about implicit casts.
[metze/wireshark/wip.git] / README.macos
1 This file tries to help building Wireshark for (Mac) OS X (Wireshark
2 does not work on earlier versions of Mac OS).
3
4 You must have the developer tools (called Xcode) installed.  For
5 versions of OS X up to and including Snow Leopard, Xcode 3 should be
6 available on the install DVD; Xcode 4 is available for download from
7 developer.apple.com and, for Lion and later releases, from the Mac App
8 Store.  See
9
10         http://guide.macports.org/chunked/installing.xcode.html
11
12 for details.  For Xcode 4, you will need to install the command-line
13 tools; select Preferences from the Xcode menu, select Downloads in the
14 Preferences window, and install Command Line Tools.
15
16 You must have X11 and the X11 developer headers and libraries installed;
17 otherwise, you will not be able to build or install GTK+, and will only
18 be able to build TShark.  The X11 and X11 SDK that come with Mac OS X
19 releases for releases from Panther to Lion can be used to build and run
20 Wireshark.  Mountain Lion does not include X11; you should install X11
21 from elsewhere, such as
22
23         http://xquartz.macosforge.org/
24
25 You must also have GLib and, if you want to build Wireshark as well as
26 TShark, GTK+.  The macosx-setup.sh script can be used to download, patch
27 as necessary, build, and install those libraries and the libraries on
28 which they depend; it will, by default, also install other libraries
29 that can be used by Wireshark and TShark.  The versions of libraries to
30 download are specified by variables set early in the script; you can
31 comment out the settings of optional libraries if you don't want them
32 downloaded and installed.  Before running the macosx-setup.sh script,
33 and before attempting to build Wireshark, make sure your PKG_CONFIG_PATH
34 environment variable's setting includes both /usr/X11/lib/pkgconfig
35 and /usr/local/lib/pkgconfig.
36
37 After you have installed those libraries:
38
39 If you are building from a Subversion tree, rather than from a source
40 distribution tarball, run the autogen.sh script.  This should not be
41 necessary if you're building from a source distribution tarball, unless
42 you've added new source files to the Wireshark source.
43
44 Then run the configure script, and run make to build Wireshark.
45
46 If you upgrade the major release of OS X on which you are building
47 Wireshark, we advise that, before you do any builds after the upgrade,
48 you do, in the build directory:
49
50     If you are building from a release tarball:
51         make distclean
52
53     If you are building from SVN:
54         make maintainer-clean
55         ./autogen.sh
56
57 Then re-run the configure script and rebuild from scratch.
58
59 On Snow Leopard (10.6) and later releases, if you are building on a
60 machine with a 64-bit processor (with the exception of the early Intel
61 Core Duo and Intel Core Solo machines, all Apple machines with Intel
62 processors have 64-bit processors), the C/C++/Objective-C compiler will
63 build 64-bit by default.
64
65 This means that you will, by default, get a 64-bit version of Wireshark.
66
67 One consequence of this is that, if you built and installed any required
68 or optional libraries for Wireshark on an earlier release of OS X, those
69 are probably 32-bit versions of the libraries, and you will need to
70 un-install them and rebuild them on your current version of OS X, to get
71 64-bit versions.
72
73 Some required and optional libraries require special attention if you
74 install them by building from source code on Snow Leopard and later
75 releases; the macosx-setup.sh script will handle that for you.
76
77 GLib - the GLib configuration script determines whether the system's
78 libiconv is GNU iconv or not by checking whether it has libiconv_open(),
79 and the compile will fail if that test doesn't correctly indicate
80 whether libiconv is GNU iconv.  In OS X, libiconv is GNU iconv, but the
81 64-bit version doesn't have libiconv_open(); a workaround for this is to
82 replace all occurrences of "libiconv_open" with "iconv_open" in the
83 configure script before running the script.  The macosx-setup.sh setup
84 script will patch GLib to work around this.
85
86 GTK+ - GTK+ 2.24.10, at least, doesn't build on Mountain Lion with the
87 CUPS printing backend - either the CUPS API changed incompatibly or the
88 backend was depending on non-API implementation details.  The
89 macosx-setup.sh setup script will, on Mountain Lion and later, configure
90 GTK+ with the CUPS printing backend disabled.
91
92 libgcrypt - the libgcrypt configuration script attempts to determine
93 which flavor of assembler-language routines to use based on the platform
94 type determined by standard autoconf code.  That code uses uname to
95 determine the processor type; however, in Mac OS X, uname always reports
96 "i386" as the processor type on Intel machines, even Intel machines with
97 64-bit processors, so it will attempt to assemble the 32-bit x86
98 assembler-language routines, which will fail.  The workaround for this
99 is to run the configure script with the --disable-asm argument, so that
100 the assembler-language routines are not used.  The macosx-setup.sh will
101 configure libgcrypt with that option.
102
103 PortAudio - when compiling on OS X, the configure script for the
104 pa_stable_v19_20071207 version of PortAudio will cause certain
105 platform-dependent build environment #defines to be set in the Makefile
106 rules, and to cause a universal build to be done; those #defines will be
107 incorrect for all but one of the architectures for which the build is
108 being done, and that will cause a compile-time error on Snow Leopard. 
109 Newer versions don't have this problem, but still fail to build on Lion
110 if a universal build is attempted.  The macosx-setup.sh script downloads
111 a newer version, and also suppresses the universal build.
112
113 GeoIP - Their man pages "helpfully" have an ISO 8859-1 copyright symbol
114 in the copyright notice, but OS X's default character encoding is UTF-8. 
115 sed on Mountain Lion barfs at the "illegal character sequence"
116 represented by an ISO 8859-1 copyright symbol, as it's not a valid UTF-8
117 sequence.  The macosx-setup.sh script uses iconv to convert the man page
118 files from ISO 8859-1 to UTF-8.
119
120 If you want to build Wireshark installer packages on a system that
121 doesn't include Xcode 3.x or earlier, you will need to install some
122 additional tools.  From the Xcode menu, select the Open Developer Tool
123 menu, and then select More Developer Tools... from that menu.  That will
124 open up a page on the Apple Developer Connection Web site; you may need
125 a developer account to download the additional tools.  Download the
126 Auxiliary Tools for Xcode package; when the dmg opens, drag all its
127 contents to the Contents/Applications subdirectory of the Xcode.app
128 directory (normally /Applications/Xcode.app/Contents/Applications); then
129 copy .../Contents/Applications/PackageMaker.app/Contents/MacOS/PackageMaker
130 to /usr/bin/packagemaker (the PackageMaker app, when run from the
131 command line rather than as a double-clicked app, is the packagemaker
132 command).