| 1 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| 2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 6 |
<title>Apple iOS (iPhone OS)</title> |
| 7 |
<link rel="stylesheet" href="gettingStarted.css" type="text/css" /> |
| 8 |
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> |
| 9 |
<link rel="start" href="index.html" title="Berkeley DB Installation and Build Guide" /> |
| 10 |
<link rel="up" href="build_unix.html" title="Chapter 7. Building Berkeley DB for UNIX/POSIX" /> |
| 11 |
<link rel="prev" href="build_unix_freebsd.html" title="FreeBSD" /> |
| 12 |
<link rel="next" href="build_unix_irix.html" title="IRIX" /> |
| 13 |
</head> |
| 14 |
<body> |
| 15 |
<div xmlns="" class="navheader"> |
| 16 |
<div class="libver"> |
| 17 |
<p>Library Version 11.2.5.3</p> |
| 18 |
</div> |
| 19 |
<table width="100%" summary="Navigation header"> |
| 20 |
<tr> |
| 21 |
<th colspan="3" align="center">Apple iOS (iPhone OS)</th> |
| 22 |
</tr> |
| 23 |
<tr> |
| 24 |
<td width="20%" align="left"><a accesskey="p" href="build_unix_freebsd.html">Prev</a> </td> |
| 25 |
<th width="60%" align="center">Chapter 7. |
| 26 |
Building Berkeley DB for UNIX/POSIX |
| 27 |
</th> |
| 28 |
<td width="20%" align="right"> <a accesskey="n" href="build_unix_irix.html">Next</a></td> |
| 29 |
</tr> |
| 30 |
</table> |
| 31 |
<hr /> |
| 32 |
</div> |
| 33 |
<div class="sect1" lang="en" xml:lang="en"> |
| 34 |
<div class="titlepage"> |
| 35 |
<div> |
| 36 |
<div> |
| 37 |
<h2 class="title" style="clear: both"><a id="build_unix_iphone"></a>Apple iOS (iPhone OS)</h2> |
| 38 |
</div> |
| 39 |
</div> |
| 40 |
</div> |
| 41 |
<p> |
| 42 |
Building Berkeley DB in Apple iOS (known as iPhone OS previously) |
| 43 |
is the same as building for a conventional UNIX platform. This |
| 44 |
section lists the commands for building Berkeley DB in both the |
| 45 |
iPhone simulator (a software simulator included in the iPhone SDK |
| 46 |
that you can use to test your application without using the |
| 47 |
iPhone/iPod Touch) and the iPhone device. |
| 48 |
</p> |
| 49 |
<p> |
| 50 |
Prior to building BDB in an iPhone simulator/iPhone device, set the |
| 51 |
required environment variables for iOS (iPhone OS). For a |
| 52 |
simulator/iPhone version 4.2 or older, set the LDFLAGS variable as |
| 53 |
follows: |
| 54 |
</p> |
| 55 |
<pre class="programlisting">export LDFLAGS="-L$SDKROOT/usr/lib/"</pre> |
| 56 |
<p> |
| 57 |
Otherwise, set LDFLAGS as follows: |
| 58 |
</p> |
| 59 |
<pre class="programlisting">export LDFLAGS="-L$SDKROOT/usr/lib/system/"</pre> |
| 60 |
<p> |
| 61 |
The steps to build BDB in an iPhone simulator are as follows: |
| 62 |
</p> |
| 63 |
<pre class="programlisting">export CFLAGS="-arch i386 -pipe -no-cpp-precomp --sysroot=$SDKROOT" |
| 64 |
export CXXFLAGS="-arch i386 -pipe -no-cpp-precomp --sysroot=$SDKROOT" |
| 65 |
cd $BDB_HOME/build_unix |
| 66 |
../dist/configure --host=i386-apple-darwin\ |
| 67 |
--prefix=$SDKROOT ... |
| 68 |
make</pre> |
| 69 |
<p> |
| 70 |
The steps to build BDB in an iPhone device are as follows: |
| 71 |
</p> |
| 72 |
<pre class="programlisting">export CFLAGS="-arch armv6 -pipe -Os -gdwarf-2\ |
| 73 |
-no-cpp-precomp -mthumb -isysroot $SDKROOT " |
| 74 |
export CXXFLAGS="-arch armv6 -pipe -Os -gdwarf-2\ |
| 75 |
-no-cpp-precomp -mthumb -isysroot $SDKROOT " |
| 76 |
cd $BDB_HOME/build_unix |
| 77 |
../dist/configure --host=arm-apple-darwin9\ |
| 78 |
--prefix=$SDKROOT ... |
| 79 |
make</pre> |
| 80 |
<p> |
| 81 |
Both sets of commands create the BDB dynamic library - |
| 82 |
libdb-5.3.dylib. To build the static library, libdb-5.3.a, add the |
| 83 |
<code class="literal">--enable-shared=no</code> option while configuring. |
| 84 |
</p> |
| 85 |
</div> |
| 86 |
<div class="navfooter"> |
| 87 |
<hr /> |
| 88 |
<table width="100%" summary="Navigation footer"> |
| 89 |
<tr> |
| 90 |
<td width="40%" align="left"><a accesskey="p" href="build_unix_freebsd.html">Prev</a> </td> |
| 91 |
<td width="20%" align="center"> |
| 92 |
<a accesskey="u" href="build_unix.html">Up</a> |
| 93 |
</td> |
| 94 |
<td width="40%" align="right"> <a accesskey="n" href="build_unix_irix.html">Next</a></td> |
| 95 |
</tr> |
| 96 |
<tr> |
| 97 |
<td width="40%" align="left" valign="top">FreeBSD </td> |
| 98 |
<td width="20%" align="center"> |
| 99 |
<a accesskey="h" href="index.html">Home</a> |
| 100 |
</td> |
| 101 |
<td width="40%" align="right" valign="top"> IRIX</td> |
| 102 |
</tr> |
| 103 |
</table> |
| 104 |
</div> |
| 105 |
</body> |
| 106 |
</html> |