libxml2 は XML を読み込み及び書き出しをするライブラリとしてはデファクトスタンダードの位置にある MITL のライブラリである。他にも Expat や Xerces や TinyXml もあるがなんとアセンブラのみで書いてるという AsmXml なんてものもある。
このエントリでは libxml2 のみに絞るが、libxml2 は最初から山盛りの設定なので、ビルドエラーを起こさないレベルでなんとかビルド出来る最小の設定を書く。以下の例は SAX を使った設定な点に注意。とはいえ最低でも http/ftp/html は無効にしておくべきだろう。
./configure \
--without-iconv \
--without-zlib \
--without-python \
--without-readline \
--without-ftp \
--without-html \
--without-http \
--without-c14n \
--without-threads \
--without-regexps \
--without-valid \
--without-xinclude \
--without-xptr \
--without-docbook \
--without-push \
--without-catalog \
--without-schematron \
--without-modules \
--disable-shared \
--enable-static
ちなみに Windows の場合は win32 ディレクトリ以下にある configure.js を cscript 経由で呼び出してビルド設定を書き出し、それを nmake でビルドする方法を採用するというやや珍しい方法をとっている。
cscript configure.js compiler=msvc debug=no ftp=no http=no html=no catalog=no docb=no iconv=no icu=no iso8859x=no zlib=no lzma=no
指定可能なオプションの詳細は help を叩くこと。かなり configure に近く、nmake install によるインストールも可能。
cscript configure.js help