To get XMLStarlet up and running on Snow Leopard is nice and easy.
- Install Xcode with the Unix the Unix Dev Support Option (see my past post about building wget for more details on this).
- Go download yourself a copy of the XMLStarlet source (I am using v 1.0.1).
- XMLStarlet requires libxml2 and libxslt. Snow Leopard ships with both these libraries installed, however they are not in the location expected by the XMLStarlet build script so some symlinks are required. Enter the following in a terminal:
sudo ln -s /usr/lib/libxslt.1.dylib /usr/lib/libxslt.a sudo ln -s /usr/lib/libexslt.dylib /usr/lib/libexslt.a sudo ln -s /usr/lib/libxml2.dylib /usr/lib/libxml2.a
- Unpack the XMLStarlet tarball by double clicking it in Finder.
Take note of the name of the newly unpacked directory (something like xmlstarlet-1.0.1).
- Open a terminal and cd to where you just unpacked (by default this will be the directory below).
cd ~/Downloads/xmlstarlet-1*
- Run the configure script:
./configure
- Run the builds
make
- Run the installer:
sudo make install
- Finally, to test that the install worked correctly enter the following in a terminal:
TA:~ troy$ xml XMLStarlet Toolkit: Command line utilities for XML ... XMLStarlet is a command line toolkit to query/edit/check/transform XML documents (for more information see http://xmlstar.sourceforge.net/)
2 comments:
I have been having problem compiling this for os 10.4.11, have you had any luck with this? It seems to want libiconv as well.
@russur I don't have an OSX 10.4 machine to try it out on. However the library does not seem to be loaded on OSX 10.6. See below.
$ otool -L `which xml`
/usr/local/bin/xml:
/usr/lib/libxslt.1.dylib (compatibility version 3.0.0, current version 3.24.0)
/usr/lib/libexslt.0.dylib (compatibility version 9.0.0, current version 9.13.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0)
/usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.3.0)
Post a Comment