By Robert Crews
Mac OS X 10.5 ("Leopard") includes libxml2 2.6.16 and libxslt 1.1.12. Some programs require newer versions, such as PostgreSQL, which requires libxml2 2.6.23 or later. This procedure describes how to add a newer version of these libraries to your system without disturbing the preinstalled versions already present. This allows you to use the newer versions as needed while allowing other software to continue using the older versions as intended. I wrote these instructions as I added libxml2 2.6.30 and libxslt 1.1.22 to my system.
To install a newer libxml2 on Mac OS X 10.5:
libxml.framework
, libxslt.framework
, and libexslt.framework
to /Library/Frameworks
.xmllint
, xsltproc
, and xmlcatalog
to /usr/local/bin
. Depending on the privileges you set on /usr/local/bin
, you might need to authenticate to complete the drag./usr/local
to the config scripts, the dynamic libraries, and the headers in the frameworks you just added. Here is the script I used:
#!/bin/sh sudo mkdir -p /usr/local/bin cd /usr/local/bin sudo ln -s /Library/Frameworks/libxml.framework/Resources/Scripts/* sudo ln -s /Library/Frameworks/libxslt.framework/Resources/Scripts/* sudo mkdir -p /usr/local/include cd /usr/local/include sudo ln -s /Library/Frameworks/libxml.framework/Headers/* sudo ln -s /Library/Frameworks/libxslt.framework/Headers/* sudo ln -s /Library/Frameworks/libexslt.framework/Headers/* mkdir -p /usr/local/lib cd /usr/local/lib sudo ln -s /Library/Frameworks/libxml.framework/libxml libxml2.dylib sudo ln -s /Library/Frameworks/libxslt.framework/libxslt libxslt.dylib sudo ln -s /Library/Frameworks/libexslt.framework/libxslt libexslt.dylib sudo mkdir -p /usr/local/man/man1 sudo mkdir -p /usr/local/man/man3 echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bashrc echo 'export MANPATH=/usr/local/man:$MANPATH' >> ~/.bashrc source ~/.bashrc