r17667@tombo: nickm | 2008-08-07 15:13:30 -0400
[tor.git] / doc / tor-osx-dmg-creation.txt
blob311b79a131919cbbed3c432099d7b72f39e84f88
1 ## Instructions for building the official dmgs for OSX.
2 ##
4 The following steps are the exact steps used to produce the "official"
5 OSX builds of tor.
7 Summary:
8 1) Compile and install a static version of the latest release of
9 libevent.
10 2) Acquire and install your preferred version of tor. Extract.
11 3) Update some variables in contrib/osx/package.sh
12 4) "make dist-osx"
13 5) You now have a dmg from which you can install Tor.
15 ## Universal Binaries for OSX PPC and X86
16 ## This method works in OSX 10.4 (Tiger) and newer OSX versions.
17 ## See far below if you don't care about cross compiling for PPC and X86.
18 ## The single architecture process starts with "###"
20 1) Install XCode 2.4.1 updates available from http://developer.apple.com.
22 ## Compiling libevent
24 2)  Download latest libevent from
25 http://www.monkey.org/~provos/libevent/
27 3) The first step of compiling libevent is to configure it as
28 follows:
29 CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" \
30 LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" \
31 ./configure --enable-static --disable-shared --disable-dependency-tracking
33 3) Complete the "make" and "make install".  You will need to be root,
34 or sudo -s, to complete the "make install".
36 4) If you have previouslly installed libevent, rm the old libevent.*, located
37 by default, in /usr/local/lib/.  
39 5) Check for a successful universal binary of libevent.a in, by default,
40 /usr/local/lib by using the following command:
41         "file /usr/local/lib/libevent.a"
43         Your output should be:
44 /usr/local/lib/libevent.a: Mach-O fat file with 2 architectures
45 /usr/local/lib/libevent.a (for architecture i386):      current ar archive random library
46 /usr/local/lib/libevent.a (for architecture ppc):       current ar archive
48 6) Get your preferred version of the tor source from https://www.torproject.org/download.  
49 Extract the tarball.
51 7) In the top level, this means /path/to/tor/, not tor/contrib/osx,
52 do a configure with these parameters:
53 CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" \
54 LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" \
55 CONFDIR=/Library/Tor \
56 ./configure --prefix=/Library/Tor --bindir=/Library/Tor \
57 --sysconfdir=/Library --disable-dependency-tracking
59 13) "make dist-osx"
61 14) Confirm you have created a universal binary by issuing the follow command:
62 "file src/or/tor".  Its output should be as follows:
63 src/or/tor: Mach-O fat file with 2 architectures
64 src/or/tor (for architecture i386):     Mach-O executable i386
65 src/or/tor (for architecture ppc):      Mach-O executable ppc
67 15) There should exist in the top-level directory a
68 Tor-$VERSION-universal-$OS-Bundle.dmg
70 16) Congrats.  You have a universal binary. You are now ready to install Tor.
72 ### Single Architecture Binaries for PPC or X86, not both.
73 ### This method works in all versions of OSX 10.3 through 10.5
75 ### Compiling libevent
77 1)  Download the latest libevent from
78 http://www.monkey.org/~provos/libevent/
80 2) The first step of compiling libevent is to configure it as
81 follows:
82        ./configure --enable-static --disable-shared
84 3) Complete the "make" and "make install".  You will need to be root,
85 or sudo -s, to complete the "make install".
87 4) If you have previouslly installed libevent, go rm the old libevent.so*
88 files so the linker doesn't get suckered into using them.
90 ### Compiling Tor
92 1) Get your preferred version of the tor source from https://www.torproject.org.  Extract the
93 tarball.
95 2) In the top level, this means /path/to/tor/, not tor/contrib/osx,
96 do a configure with these parameters:
97      CONFDIR=/Library/Tor ./configure --prefix=/Library/Tor \
98      --bindir=/Library/Tor --sysconfdir=/Library
100 3) In same top level dir, do a "make dist-osx".  There now exists a
101 .dmg file in the same directory.  Install from this dmg.