libbson is a library providing useful routines related to building, parsing, and iterating BSON documents. It is a useful base for those wanting to write high-performance C extensions to higher level languages such as python, ruby, or perl.
yum install git automake autoconf libtool gcc
apt-get install git-core automake autoconf libtool gcc
pkg install git automake autoconf libtool gcc pkgconf
pkgin install git automake autoconf libtool gcc47 gmake pkg-config
export PATH=/opt/local/gcc47/bin:$PATH
Builds on Windows Vista and Higher require cmake to build Visual Studio project files. Alternatively, you can use cygwin or mingw with the automake based build.
git clone git://github.com/mongodb/libbson.git
cd libbson
cmake.exe build\cmake
msbuild.exe ALL_BUILD.vcxproj
For the adventurous, you can cross-compile for Windows from Fedora easily using mingw.
./configure --host=x86_64-w64-mingw32
$ git clone git://github.com/mongodb/libbson.git
$ cd libbson/
$ ./autogen.sh
$ make
$ sudo make install
You can run the unit tests with
make test
tar xzf libbson-$ver.tar.gz
./configure --enable-silent-rules
make
sudo make install
In your source code:
#include <bson.h>
To get the include path and libraries appropriate for your system.
gcc my_program.c $(pkg-config --cflags --libs libbson-1.0)
See the examples/
directory for how to use the libbson library in your
application.
See the doc/
directory for documentation on individual types.