libbson 1.6.1-cocoapods-rc1

libbson 1.6.1-cocoapods-rc1

测试已测试
Lang语言 CC
许可 Apache 2
发布最后发布2017年3月

Paul Melnikow 维护。



libbson 1.6.1-cocoapods-rc1

Libbson

libbson 是一个库,提供了与构建、解析和迭代 BSON 文档相关的实用程序。对于想要为 Python、Ruby 或 Perl 等高级语言编写高性能 C 扩展的开发者非常有用。

构建

libbson 尝试支持多种操作系统和架构。以下是一些已知可以工作的情况。如果您的平台未在此列出,它可能仍然有效,我们只是尚未测试。如果您希望我们将您的平台添加到此处,我们将非常高兴听到您的意见。

支持的操作系统

  • RHEL/CentOS 5, 6, 7beta
  • SLES 11 SP3
  • Ubuntu 12.04 LTS
  • Debian 7
  • SmartOS
  • Solaris
  • FreeBSD 10
  • Windows Vista, 7, 8

支持的架构

  • x86
  • x86_64/amd64
  • SPARC
  • ARM
  • PowerPC

支持的编译器

  • GCC 4.1 及以上
  • Clang 3.3 及以上
  • Visual Studio (MSVC) 2010 及以上
  • Oracle Solaris Studio (5.7 及以上,Solaris 10)

依赖项

Fedora / RedHat Enterprise / CentOS

yum install git automake autoconf libtool gcc

Debian / Ubuntu

apt-get install git-core automake autoconf libtool gcc

FreeBSD

pkg install git automake autoconf libtool gcc pkgconf

SmartOS

pkgin install git automake autoconf libtool gcc47 gmake pkg-config
export PATH=/opt/local/gcc47/bin:$PATH

Windows Vista 及以上

Windows Vista 及以上版本的构建需要 cmake 来构建 Visual Studio 项目文件。或者,您可以使用基于 automake 的构建与 cygwin 或 mingw 一起使用。

git clone git://github.com/mongodb/libbson.git
cd libbson
cmake.exe -G "Visual Studio 10 Win64" "-DCMAKE_INSTALL_PREFIX=C:\install\path"
msbuild.exe ALL_BUILD.vcxproj
msbuild.exe INSTALL.vcxproj

对于有冒险精神的人,您可以使用 mingw 从 Fedora 容易地交叉编译 Windows 版本。

sudo yum install mingw64-gcc automake autoconf libtool
./configure --host=x86_64-w64-mingw32

从 Git

git clone git://github.com/mongodb/libbson.git
cd libbson/
./autogen.sh
make
sudo make install

您可以使用以下命令运行单元测试:

make test

从 Tarball 开始

tar xzf libbson-$ver.tar.gz
./configure
make
sudo make install

配置选项

以下是一些可能在 ./configure 中使用的选项。当使用替代的 CMake 构建系统时,这些选项不可用。

--help                    Show all possible help options.
                          There are many more than those displayed here.

--enable-optimizations    Enable various compile and link optimizations.
--enable-debug            Enable debugging features.
--enable-debug-symbols    Link with debug symbols in tact.
--enable-hardening        Enable stack protector and other hardening features.
--enable-silent-rules     Force silent rules like the Linux kernel.
--enable-coverage         Compile with gcov support.
--enable-static           Build static archives (.a).

使用 libbson 进行开发

在您的源代码中

#include <bson.h>

以获取适合您系统的包含路径和库。

gcc my_program.c $(pkg-config --cflags --libs libbson-1.0)

示例

请参阅 examples/ 目录,了解如何在您的应用程序中使用 libbson 库。

文档

请在 doc/ 目录中查看单个类型的文档。

错误报告和功能请求

请使用 MongoDB C Driver JIRA 项目来报告错误或请求功能。