[cfe-commits] [libcxx] r167490 - /libcxx/trunk/www/index.html
Howard Hinnant
hhinnant at apple.com
Tue Nov 6 13:31:37 PST 2012
Author: hhinnant
Date: Tue Nov 6 15:31:37 2012
New Revision: 167490
URL: http://llvm.org/viewvc/llvm-project?rev=167490&view=rev
Log:
Update instructions for building and using libc++ on Mac OS
Modified:
libcxx/trunk/www/index.html
Modified: libcxx/trunk/www/index.html
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/index.html?rev=167490&r1=167489&r2=167490&view=diff
==============================================================================
--- libcxx/trunk/www/index.html (original)
+++ libcxx/trunk/www/index.html Tue Nov 6 15:31:37 2012
@@ -139,20 +139,13 @@
</ul>
<p>
- On Mac OS 10.7 (Lion), the easiest way to get this library is to install
+ On Mac OS 10.7 (Lion) and later, the easiest way to get this library is to install
Xcode 4.2 or later. However if you want to install tip-of-trunk from here
(getting the bleeding edge), read on. However, be warned that Mac OS
10.7 will not boot without a valid copy of <code>libc++.1.dylib</code> in
<code>/usr/lib</code>.
</p>
- <p>To build on Mac OS X 10.6 (Snow Leopard), you need a helper library and header
- <a href="http://home.roadrunner.com/~hinnant/libcppabi.zip">found here</a>.
- cp cxxabi.h to /usr/include, and cp libc++abi.dylib to /usr/lib. On Mac OS
- X 10.7 (Lion) and later, this helper library and header are already installed
- for you.
- <p>
-
<p>
Next:
</p>
@@ -160,30 +153,34 @@
<ul>
<li><code>cd libcxx/lib</code></li>
<li><code>export TRIPLE=-apple-</code></li>
- <li>Only on 10.6: <code>export MACOSX_DEPLOYMENT_TARGET=10.6</code></li>
<li><code>./buildit</code></li>
+ <li><code>ln -sf libc++.1.dylib libc++.dylib</code></li>
</ul>
<p>
- That should result in a libc++.1.dylib. To install it I like to use links
- instead of copying, but either should work:
+ That should result in a libc++.1.dylib and libc++.dylib. The safest thing
+ to do is to use it from where your libcxx is installed instead of replacing
+ these in your Mac OS.
+ </p>
+
+ <p>
+ To use your system-installed libc++ with clang you can:
</p>
<ul>
- <li><code>cd /usr/lib</code></li>
- <li><code>sudo ln -sf path-to-libcxx/lib/libc++.1.dylib libc++.1.dylib</code></li>
- <li><code>sudo ln -sf libc++.1.dylib libc++.dylib</code></li>
- <li><code>cd /usr/include/c++</code></li>
- <li><code>sudo ln -sf path-to-libcxx/include v1</code></li>
+ <li><code>clang++ -stdlib=libc++ test.cpp</code></li>
+ <li><code>clang++ -std=c++11 -stdlib=libc++ test.cpp</code></li>
</ul>
<p>
- To use with clang you can:
+ To use your tip-of-trunk libc++ on Mac OS with clang you can:
</p>
<ul>
- <li><code>clang++ -stdlib=libc++ test.cpp</code></li>
- <li><code>clang++ -std=c++11 -stdlib=libc++ test.cpp</code></li>
+ <li><code>export DYLD_LIBRARY_PATH=<path-to-libcxx>/lib</code>
+ <li><code>clang++ -std=c++11 -stdlib=libc++ -nostdinc++
+ -I<path-to-libcxx>/include -L<path-to-libcxx>/lib
+ test.cpp</code></li>
</ul>
<p>To run the libc++ test suite (recommended):</p>
@@ -192,14 +189,8 @@
<li><code>cd libcxx/test</code></li>
<li><code>./testit</code></li>
<ul>
- <li>On Mac OS 10.6, to work around bugs in libc headers like
- math.h and inttypes.h, add "-U__STRICT_ANSI__" and
- "-D__STDC_FORMAT_MACROS" to the command line with:
- <blockquote>
- <pre>export OPTIONS="-std=c++11 -stdlib=libc++ -U__STRICT_ANSI__ -D__STDC_FORMAT_MACROS"</pre>
- </blockquote></li>
- <li>People porting libc++ to other OSes will likely have to
- define similar macros.</li>
+ <li>You can alter the command line options <code>testit</code> uses
+ with <code>export OPTIONS="whatever you need"</code></li>
</ul>
</ul>
More information about the cfe-commits
mailing list