[MacPorts] LibcxxOnOlderSystems added

Ryan Schmidt ryandesign at macports.org
Sun Jan 11 18:27:40 PST 2015


On Jan 11, 2015, at 7:51 PM, MacPorts <noreply at macports.org> wrote:
> 
> 1. Start with a new install of MacPorts or '''uninstall all ports that use C++'''
> 2. Install the libcxx port.  When it activates, the libcxxabi and libcxx ports will install libc++.dylib and libc++abi.dylib (which will remain after you uninstall MacPorts).  This will pull in a number of dependencies.
> {{{
> sudo port -v -s install libcxx
> }}}
> 3. Deactivate all your active ports (or at least the C++ ports) in order to prepare to rebuild them, and just activate the new toolchain:
> {{{
> 	sudo port -v -f deactivate active
> 	sudo port -v install clang-3.4 ld64 cctools
> }}}
> 4. Edit /opt/local/etc/macports/macports.conf to contain:
> {{{
> cxx_stdlib         libc++
> buildfromsource    always
> delete_la_files    yes
> default_compilers  macports-clang-3.4 macports-clang-3.3 gcc-4.2 apple-gcc-4.2 gcc-4.0
> }}}
> 5. Uninstall all the remaining inactive ports:
> {{{
> sudo port -v -f uninstall inactive
> }}}
> 6. Build a newer clang compiler using libc++ and uninstall the old one using libstdc++:
> {{{
> sudo port -v install clang-3.5
> sudo port -v uninstall llvm-3.4 clang-3.4
> }}}
> 7. Either:
>    1. Edit /opt/local/etc/macports/macports.conf again to add macports-clang-3.5 before macports-clang-3.4.
>    2. Rebuild clang-3.4 using clang-3.5:
> {{{
> sudo port -v install clang-3.4 configure.compiler=macports-clang-3.5
> }}}

Step 7.2. seems fragile. What if the version or revision of clang-3.4 is later increased, which would cause the port to rebuild, and it wouldn't rebuild with MacPorts clang-3.5 that time. Seems like it's better to recommend step 7.1. and not offer an alternative.



More information about the macports-dev mailing list