pax_global_header 0000666 0000000 0000000 00000000064 13225757660 0014527 g ustar 00root root 0000000 0000000 52 comment=d2ebd1952ee637dca9b9588213f1f0b88e712c17
libbson-1.9.2/ 0000775 0000000 0000000 00000000000 13225757660 0013170 5 ustar 00root root 0000000 0000000 libbson-1.9.2/.clang-format 0000664 0000000 0000000 00000002010 13225757660 0015534 0 ustar 00root root 0000000 0000000 ---
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: 'false'
AlignConsecutiveDeclarations: 'false'
AlignEscapedNewlinesLeft: 'true'
AllowAllParametersOfDeclarationOnNextLine: 'true'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: 'false'
AllowShortLoopsOnASingleLine: 'false'
AlwaysBreakAfterReturnType: All
BinPackArguments: 'false'
BinPackParameters: 'false'
BreakBeforeBraces: Linux
ColumnLimit: '80'
ContinuationIndentWidth: '3'
IndentCaseLabels: 'false'
IndentWidth: '3'
KeepEmptyLinesAtTheStartOfBlocks: 'false'
Language: Cpp
MaxEmptyLinesToKeep: '2'
SortIncludes: 'false'
SpaceAfterCStyleCast: 'true'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeParens: Always
SpaceInEmptyParentheses: 'false'
SpacesInAngles: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInContainerLiterals: 'true'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
Standard: Cpp11
TabWidth: '3'
UseTab: Never
...
libbson-1.9.2/.evergreen/ 0000775 0000000 0000000 00000000000 13225757660 0015230 5 ustar 00root root 0000000 0000000 libbson-1.9.2/.evergreen/check-release-archive.sh 0000664 0000000 0000000 00000004027 13225757660 0021701 0 ustar 00root root 0000000 0000000 #!/bin/sh
set -o xtrace # Write all commands first to stderr
set -o errexit # Exit the script with error if any of the commands fail
# Check that a CLion user didn't accidentally convert NEWS from UTF-8 to ASCII
news_type=`file NEWS`
echo "NEWS file type is $news_type"
case "$news_type" in
*ASCII*)
echo '{ "results": [ { "status": "FAIL", "test_file": "Create Release Archive" } ] }' > test-results.json
exit 1
;;
esac
echo '{ "results": [ { "status": "pass", "test_file": "Create Release Archive",' > test-results.json
start=$(date +%s)
echo '"start": ' $start ', ' >> test-results.json
# Use modern sphinx-build from venv.
. venv/bin/activate
which sphinx-build
sphinx-build --version
./autogen.sh --enable-html-docs --enable-man-pages && make distcheck
# Check that docs were included, but sphinx temp files weren't.
tarfile=libbson-*.tar.gz
docs='libbson-*/doc/html/index.html libbson-*/doc/man/bson_t.3'
tmpfiles='libbson-*/doc/html/.doctrees \
libbson-*/doc/html/.buildinfo \
libbson-*/doc/man/.doctrees \
libbson-*/doc/man/.buildinfo'
echo "Checking for built docs"
for doc in $docs; do
# Check this doc is in the archive.
tar --wildcards -tzf $tarfile $doc
done
echo "Checking that temp files are not included in tarball"
for tmpfile in $tmpfiles; do
# Check this temp file doesn't exist.
if tar --wildcards -tzf $tarfile $tmpfile > /dev/null 2>&1; then
echo "Found temp file in archive: $tmpfile"
exit 1
fi
done
echo "Checking that all C files are included in tarball"
# Check that all C files were included.
TAR_CFILES=`tar --wildcards -tf libbson-*.tar.gz 'libbson-*/src/bson/*.c' | cut -d / -f 4 | sort`
SRC_CFILES=`echo src/bson/*.c | xargs -n 1 | cut -d / -f 3 | sort`
if [ "$TAR_CFILES" != "$SRC_CFILES" ]; then
echo "Not all C files are in the release archive"
echo $TAR_CFILES > tar_cfiles.txt
echo $SRC_CFILES | diff -y - tar_cfiles.txt
fi
end=$(date +%s)
echo '"end": ' $end ', ' >> test-results.json
sum=$(expr $end - $start)
echo '"elapsed": ' $sum ' } ] }' >> test-results.json
libbson-1.9.2/.evergreen/compile-unix.sh 0000664 0000000 0000000 00000007602 13225757660 0020202 0 ustar 00root root 0000000 0000000 #!/bin/sh
set -o xtrace # Write all commands first to stderr
set -o errexit # Exit the script with error if any of the commands fail
# Supported/used environment variables:
# CFLAGS Additional compiler flags
# MARCH Machine Architecture. Defaults to lowercase uname -m
# RELEASE Use the fully qualified release archive
# DEBUG Use debug configure flags
# VALGRIND Run the test suite through valgrind
# CC Which compiler to use
# ANALYZE Run the build through clang's scan-build
# COVERAGE Run code coverage
echo "CFLAGS: $CFLAGS"
echo "MARCH: $MARCH"
echo "RELEASE: $RELEASE"
echo "DEBUG: $DEBUG"
echo "VALGRIND: $VALGRIND"
echo "CC: $CC"
echo "ANALYZE $ANALYZE"
echo "COVERAGE $COVERAGE"
# Get the kernel name, lowercased
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
echo "OS: $OS"
# Automatically retrieve the machine architecture, lowercase, unless provided
# as an environment variable (e.g. to force 32bit)
[ -z "$MARCH" ] && MARCH=$(uname -m | tr '[:upper:]' '[:lower:]')
# Default configure flags for debug builds and release builds
DEBUG_FLAGS="\
--enable-optimizations=no \
--enable-man-pages=no \
--enable-html-docs=no \
--enable-extra-align=no \
--enable-maintainer-flags \
--enable-debug"
RELEASE_FLAGS="
--enable-optimizations \
--enable-man-pages=no \
--enable-html-docs=no \
--enable-extra-align=no"
# By default we build from git clone, which requires autotools
# This gets overwritten if we detect we should use the release archive
CONFIGURE_SCRIPT="./autogen.sh"
# --strip-components is an GNU tar extension. Check if the platform
# has GNU tar installed as `gtar`, otherwise we assume to be on
# platform that supports it
# command -v returns success error code if found and prints the path to it
if command -v gtar 2>/dev/null; then
TAR=gtar
else
TAR=tar
fi
# Available on our Ubuntu 16.04 images
[ "$ANALYZE" ] && SCAN_BUILD="scan-build-3.8 -o scan --status-bugs"
# UndefinedBehaviorSanitizer configuration
UBSAN_OPTIONS="print_stacktrace=1 abort_on_error=1"
# AddressSanitizer configuration
ASAN_OPTIONS="detect_leaks=1 abort_on_error=1"
# LeakSanitizer configuration
LSAN_OPTIONS="log_pointers=true"
case "$MARCH" in
i386)
CFLAGS="$CFLAGS -m32 -march=i386"
;;
x86_64)
CFLAGS="$CFLAGS -m64 -march=x86-64"
;;
ppc64le)
CFLAGS="$CFLAGS -mcpu=power8 -mtune=power8 -mcmodel=medium"
;;
esac
case "$OS" in
darwin)
CFLAGS="$CFLAGS -Wno-unknown-pragmas"
# llvm-cov is installed from brew
export PATH=$PATH:/usr/local/opt/llvm/bin
;;
linux)
# Make linux builds a tad faster by parallelise the build
cpus=$(grep -c '^processor' /proc/cpuinfo)
MAKEFLAGS="-j${cpus}"
;;
esac
case "$CC" in
clang)
;;
gcc)
;;
esac
CFLAGS="$CFLAGS -Werror"
[ "$DEBUG" ] && CONFIGURE_FLAGS=$DEBUG_FLAGS || CONFIGURE_FLAGS=$RELEASE_FLAGS
[ "$VALGRIND" ] && TARGET="valgrind" || TARGET="test"
[ "$COVERAGE" ] && CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-coverage"
if [ "$RELEASE" ]; then
# Build from the release tarball.
mkdir build-dir
$TAR xf ../libbson.tar.gz -C build-dir --strip-components=1
cd build-dir
CONFIGURE_SCRIPT="./configure"
fi
CFLAGS="$CFLAGS" CC="$CC" $SCAN_BUILD $CONFIGURE_SCRIPT $CONFIGURE_FLAGS
# Write stderr to error.log and to console.
mkfifo pipe
tee error.log < pipe &
$SCAN_BUILD make $TARGET TEST_ARGS="--no-fork -d -F test-results.json" 2>pipe
rm pipe
if [ "$COVERAGE" ]; then
case "$CC" in
clang)
lcov --gcov-tool `pwd`/.evergreen/llvm-gcov.sh --capture --derive-func-data --directory . --output-file .coverage.lcov --no-external
;;
*)
lcov --gcov-tool gcov --capture --derive-func-data --directory . --output-file .coverage.lcov --no-external
;;
esac
genhtml .coverage.lcov --legend --title "libbson code coverage" --output-directory coverage
fi
libbson-1.9.2/.evergreen/compile-windows.sh 0000664 0000000 0000000 00000004122 13225757660 0020703 0 ustar 00root root 0000000 0000000 #!/bin/sh
set -o igncr # Ignore CR in this script
set -o xtrace # Write all commands first to stderr
set -o errexit # Exit the script with error if any of the commands fail
# Supported/used environment variables:
# CC Which compiler to use
# RELEASE Enable release-build MSVC flags and build from release
# tarball (default: debug flags, build from git)
CC=${CC:-"Visual Studio 14 2015 Win64"}
echo "CC: $CC"
echo "RELEASE: $RELEASE"
CONFIGURE_FLAGS="-DCMAKE_INSTALL_PREFIX=C:/libbson -DENABLE_EXAMPLES:BOOL=ON -DENABLE_MAINTAINER_FLAGS=ON"
BUILD_FLAGS="/m" # Number of concurrent processes. No value=# of cpus
if [ "$RELEASE" ]; then
CONFIGURE_FLAGS="$CONFIGURE_FLAGS -DCMAKE_BUILD_TYPE=Release"
BUILD_FLAGS="$BUILD_FLAGS /p:Configuration=Release"
TEST_PATH="./Release/test-libbson.exe"
# Build from the release tarball.
mkdir build-dir
tar xf ../libbson.tar.gz -C build-dir --strip-components=1
cd build-dir
else
CONFIGURE_FLAGS="$CONFIGURE_FLAGS -DCMAKE_BUILD_TYPE=Debug"
BUILD_FLAGS="$BUILD_FLAGS /p:Configuration=Debug"
TEST_PATH="./Debug/test-libbson.exe"
fi
case "$CC" in
mingw*)
if [ "$RELEASE" ]; then
cmd.exe /c ..\\.evergreen\\compile.bat
else
cmd.exe /c .evergreen\\compile.bat
fi
exit 0
;;
# Resolve the compiler name to correct MSBuild location
"Visual Studio 10 2010")
BUILD="/cygdrive/c/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe"
;;
"Visual Studio 10 2010 Win64")
BUILD="/cygdrive/c/Windows/Microsoft.NET/Framework64/v4.0.30319/MSBuild.exe"
;;
"Visual Studio 12 2013" | "Visual Studio 12 2013 Win64")
BUILD="/cygdrive/c/Program Files (x86)/MSBuild/12.0/Bin/MSBuild.exe"
;;
"Visual Studio 14 2015" | "Visual Studio 14 2015 Win64")
BUILD="/cygdrive/c/Program Files (x86)/MSBuild/14.0/Bin/MSBuild.exe"
;;
esac
rm -rf cbuild
mkdir cbuild
cd cbuild
CMAKE="/cygdrive/c/cmake/bin/cmake"
"$CMAKE" -G "$CC" $CONFIGURE_FLAGS ..
"$BUILD" $BUILD_FLAGS ALL_BUILD.vcxproj
"$BUILD" $BUILD_FLAGS INSTALL.vcxproj
"$TEST_PATH" --no-fork -d
libbson-1.9.2/.evergreen/compile.bat 0000664 0000000 0000000 00000000745 13225757660 0017356 0 ustar 00root root 0000000 0000000 rem Ensure Cygwin executables like sh.exe are not in PATH
set PATH=C:\Windows\system32;C:\Windows;C:/mingw-w64/x86_64-4.9.1-posix-seh-rt_v3-rev1/mingw64/bin
set CMAKE_MAKE_PROGRAM=C:\mingw-w64\x86_64-4.9.1-posix-seh-rt_v3-rev1\mingw64\bin\mingw32-make.exe
set CC=C:\mingw-w64\x86_64-4.9.1-posix-seh-rt_v3-rev1\mingw64\bin\gcc.exe
c:\cmake\bin\cmake -G "MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=%CMAKE_MAKE_PROGRAM%
%CMAKE_MAKE_PROGRAM%
test-libbson.exe --no-fork -F test-results.json
libbson-1.9.2/.evergreen/compile.sh 0000664 0000000 0000000 00000001171 13225757660 0017214 0 ustar 00root root 0000000 0000000 #!/bin/sh
set -o xtrace # Write all commands first to stderr
set -o errexit # Exit the script with error if any of the commands fail
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
echo '{ "results": [ { "status": "pass", "test_file": "Create Release Archive",' > test-results.json
start=$(date +%s)
echo '"start": ' $start ', ' >> test-results.json
case "$OS" in
cygwin*)
sh ./.evergreen/compile-windows.sh
;;
*)
sh ./.evergreen/compile-unix.sh
;;
esac
end=$(date +%s)
echo '"end": ' $end ', ' >> test-results.json
sum=$(expr $end - $start || true)
echo '"elapsed": ' $sum ' } ] }' >> test-results.json
libbson-1.9.2/.evergreen/config.yml 0000664 0000000 0000000 00000046602 13225757660 0017230 0 ustar 00root root 0000000 0000000 #####################################
# Evergreen configuration for libbson
#####################################
stepback: true
command_type: system
exec_timeout_secs: 1800 # 30 minutes is the longest we'll ever run
functions:
"upload docs" :
- command: shell.exec
params:
silent: true
working_dir: "libbson"
script: |
export AWS_ACCESS_KEY_ID=${aws_key}
export AWS_SECRET_ACCESS_KEY=${aws_secret}
sudo apt-get install -y awscli
aws s3 cp doc/html s3://mciuploads/${project}/docs/${CURRENT_VERSION} --recursive --acl public-read --region us-east-1
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: libbson/doc/html/index.html
remote_file: ${project}/docs/${CURRENT_VERSION}/index.html
bucket: mciuploads
permissions: public-read
content_type: text/html
display_name: "Rendered docs"
"upload man pages" :
- command: shell.exec
params:
silent: true
working_dir: "libbson"
script: |
. venv/bin/activate
# "man" with redirection writes plain ASCII, use lower-level groff to
# force formatted output. -t lays out tables, -T utf8 sets the output
# type, -man loads the manpage TROFF macros.
for doc in doc/man/*.3; do
echo $doc
fullpath=`pwd`/$doc
groff -man -t -T utf8 $fullpath | term2image -o $fullpath.png
done
mkdir -p man-page-images
mv doc/man/*.png man-page-images
export AWS_ACCESS_KEY_ID=${aws_key}
export AWS_SECRET_ACCESS_KEY=${aws_secret}
sudo apt-get install -y awscli
aws s3 cp man-page-images s3://mciuploads/${project}/man-page-images/${CURRENT_VERSION} --recursive --acl public-read --region us-east-1
sh .evergreen/man-page-image-list.sh man-page-images > man-page-images/index.html
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: libbson/man-page-images/index.html
remote_file: ${project}/man-page-images/${CURRENT_VERSION}/index.html
bucket: mciuploads
permissions: public-read
content_type: text/html
display_name: "Rendered man pages"
"upload coverage" :
- command: shell.exec
params:
silent: true
working_dir: "libbson"
script: |
export AWS_ACCESS_KEY_ID=${aws_key}
export AWS_SECRET_ACCESS_KEY=${aws_secret}
sudo apt-get install -y awscli
aws s3 cp coverage s3://mciuploads/${project}/${build_variant}/${revision}/${version_id}/${build_id}/coverage/ --recursive --acl public-read
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: libbson/coverage/index.html
remote_file: ${project}/${build_variant}/${revision}/${version_id}/${build_id}/coverage/index.html
bucket: mciuploads
permissions: public-read
content_type: text/html
display_name: "Coverage Report"
"fetch source" :
- command: git.get_project
params:
directory: libbson
- command: git.apply_patch
params:
directory: "libbson"
- command: shell.exec
params:
working_dir: "libbson"
script: |
# Since we cannot conditionally define evergreen expansions, but we can
# load expansions from external file, we dynamically generate a file
# containing the exact folder name we'd like to upload the docs to,
# depending on if its a patch build or regular evergreen build
if [ "${is_patch}" = "true" ]; then
VERSION=$(git describe --abbrev=7)-patch-${version_id}
else
VERSION=latest
fi
echo "CURRENT_VERSION: $VERSION" > expansion.yml
- command: expansions.update
params:
file: libbson/expansion.yml
- command: shell.exec
params:
continue_on_err: true
# Must be http as RHEL55 has https issues
script: |
set -o xtrace
rm -f *.tar.gz
curl --retry 5 http://s3.amazonaws.com/mciuploads/libbson/${branch_name}/libbson-${CURRENT_VERSION}.tar.gz --output libbson.tar.gz --silent --max-time 120 --fail
"upload release":
- command: shell.exec
params:
script: mv libbson/libbson*gz libbson.tar.gz
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: libbson.tar.gz
remote_file: libbson/${branch_name}/libbson-${CURRENT_VERSION}.tar.gz
bucket: mciuploads
permissions: public-read
content_type: ${content_type|application/x-gzip}
"upload scan artifacts":
- command: shell.exec
params:
working_dir: "libbson"
script: tar czf scan.tar.gz scan
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: libbson/scan.tar.gz
remote_file: libbson/${build_variant}/${revision}/${version_id}/${build_id}/artifacts/scan.tar.gz
bucket: mciuploads
permissions: public-read
content_type: ${content_type|application/x-gzip}
"upload artifacts":
- command: shell.exec
params:
working_dir: "."
script: tar czf artifacts.tar.gz libbson
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: artifacts.tar.gz
remote_file: libbson/${build_variant}/${revision}/${version_id}/${build_id}/artifacts/artifacts.tar.gz
bucket: mciuploads
permissions: public-read
content_type: ${content_type|application/x-gzip}
display_name: "artifacts.tar.gz"
"upload results" :
command: attach.results
params:
file_location: "libbson/test-results.json"
"windows fix":
- command: shell.exec
params:
working_dir: "libbson"
script: |
for i in $(find .evergreen -name \*.sh); do
cat $i | tr -d '\r' > $i.new
mv $i.new $i
done
pre:
- func: "fetch source"
- func: "windows fix"
post:
- func: "upload artifacts"
- func: "upload scan artifacts"
- func: "upload results"
#######################################
# Tasks #
#######################################
tasks:
- name: debug-compile
commands:
- command: shell.exec
type: test
params:
working_dir: "libbson"
script: "DEBUG=1 CC=${CC} MARCH='${MARCH}' sh .evergreen/compile.sh"
- name: debug-compile-c11
commands:
- command: shell.exec
type: test
params:
working_dir: "libbson"
script: "DEBUG=1 CC='${CC}' MARCH='${MARCH}' CFLAGS='-std=c11 -D_XOPEN_SOURCE=600' sh .evergreen/compile.sh"
- name: debug-compile-c99
commands:
- command: shell.exec
type: test
params:
working_dir: "libbson"
script: "DEBUG=1 CC='${CC}' MARCH='${MARCH}' CFLAGS='-std=c99 -D_XOPEN_SOURCE=600' sh .evergreen/compile.sh"
- name: debug-compile-c89
commands:
- command: shell.exec
type: test
params:
working_dir: "libbson"
script: "DEBUG=1 CC='${CC}' MARCH='${MARCH}' CFLAGS='-std=c89 -D_POSIX_C_SOURCE=200112L' sh .evergreen/compile.sh"
- name: debug-compile-valgrind
commands:
- command: shell.exec
type: test
params:
working_dir: "libbson"
script: "VALGRIND=1 DEBUG=1 CC='${CC}' MARCH='${MARCH}' sh .evergreen/compile.sh"
- name: debug-compile-sanitizer-address
commands:
- command: shell.exec
type: test
params:
working_dir: "libbson"
script: "PATH=/usr/lib/llvm-3.8/bin:$PATH DEBUG=1 CC='clang-3.8' MARCH='${MARCH}' CFLAGS='-fsanitize=address' sh .evergreen/compile.sh"
- name: debug-compile-sanitizer-undefined
commands:
- command: shell.exec
type: test
params:
working_dir: "libbson"
script: |
PATH=/usr/lib/llvm-3.8/bin:$PATH DEBUG=1 CC='clang-3.8' MARCH='${MARCH}' CFLAGS='-fsanitize=undefined' sh .evergreen/compile.sh
grep -v "^ar: " error.log > log.log
if [ -s log.log ]; then
cat log.log
exit 2
fi
- name: debug-compile-scan-build
commands:
- command: shell.exec
type: test
params:
working_dir: "libbson"
script: "DEBUG=1 CC=clang ANALYZE=1 MARCH='${MARCH}' sh .evergreen/compile.sh"
- name: debug-compile-coverage
commands:
- command: shell.exec
type: test
params:
working_dir: "libbson"
script: |
sudo apt-get -y install lcov
DEBUG=1 CC='${CC}' COVERAGE=1 MARCH='${MARCH}' sh .evergreen/compile.sh
- func: "upload coverage"
- name: make-release-archive
commands:
- command: shell.exec
type: test
params:
working_dir: "libbson"
script: |
# Need modern Sphinx so it includes :doc: targets in objects.inv.
# Install term2image for man page rendering.
python -m virtualenv venv
cd venv
. bin/activate
./bin/pip install sphinx git+https://github.com/ajdavis/term2image.git
cd ..
- command: shell.exec
type: test
params:
working_dir: "libbson"
script: |
sh .evergreen/check-release-archive.sh
- func: "upload docs"
- func: "upload man pages"
- func: "upload release"
- name: release-compile
depends_on:
- name: "make-release-archive"
variant: releng
commands:
- command: shell.exec
type: test
params:
working_dir: "libbson"
script: "CC='${CC}' MARCH='${MARCH}' RELEASE=1 sh .evergreen/compile.sh"
- name: link-with-cmake
depends_on:
- name: "make-release-archive"
variant: releng
commands:
- command: shell.exec
type: test
params:
working_dir: "libbson"
script: |
set -o xtrace
set -o errexit
# Build libbson with the Autotools or CMake and compile a program
# that links dynamically or statically to libbson, using
# variables from CMake's find_package command.
BUILD_LIBBSON_WITH_CMAKE= LINK_STATIC= BUILD_SAMPLE_WITH_CMAKE=1 sh .evergreen/link-sample-program.sh
BUILD_LIBBSON_WITH_CMAKE=1 LINK_STATIC= BUILD_SAMPLE_WITH_CMAKE=1 sh .evergreen/link-sample-program.sh
BUILD_LIBBSON_WITH_CMAKE= LINK_STATIC=1 BUILD_SAMPLE_WITH_CMAKE=1 sh .evergreen/link-sample-program.sh
BUILD_LIBBSON_WITH_CMAKE=1 LINK_STATIC=1 BUILD_SAMPLE_WITH_CMAKE=1 sh .evergreen/link-sample-program.sh
- name: link-with-cmake-windows
depends_on:
- name: "make-release-archive"
variant: releng
commands:
- command: shell.exec
type: test
params:
working_dir: "libbson"
script: |
set -o xtrace
set -o errexit
# Build libbson with CMake (not Autotools) and compile a program
# that links dynamically or statically to libbson, using
# variables from CMake's find_package command.
LINK_STATIC= cmd.exe /c .\\.evergreen\\link-sample-program.cmd
LINK_STATIC=1 cmd.exe /c .\\.evergreen\\link-sample-program.cmd
- name: link-with-pkg-config
depends_on:
- name: "make-release-archive"
variant: releng
commands:
- command: shell.exec
type: test
params:
working_dir: "libbson"
script: |
set -o xtrace
set -o errexit
# Build libbson with the Autotools or CMake and compile a program
# that links dynamically or statically to libbson, using
# variables from "pkg-config".
BUILD_LIBBSON_WITH_CMAKE= LINK_STATIC= BUILD_SAMPLE_WITH_CMAKE= sh .evergreen/link-sample-program.sh
BUILD_LIBBSON_WITH_CMAKE=1 LINK_STATIC= BUILD_SAMPLE_WITH_CMAKE= sh .evergreen/link-sample-program.sh
BUILD_LIBBSON_WITH_CMAKE= LINK_STATIC=1 BUILD_SAMPLE_WITH_CMAKE= sh .evergreen/link-sample-program.sh
BUILD_LIBBSON_WITH_CMAKE=1 LINK_STATIC=1 BUILD_SAMPLE_WITH_CMAKE= sh .evergreen/link-sample-program.sh
- name: release-compile-c11
depends_on:
- name: "make-release-archive"
variant: releng
commands:
- command: shell.exec
type: test
params:
working_dir: "libbson"
script: "CC='${CC}' MARCH='${MARCH}' CFLAGS='-std=c11 -D_XOPEN_SOURCE=600' RELEASE=1 sh .evergreen/compile.sh"
- name: release-compile-c99
depends_on:
- name: "make-release-archive"
variant: releng
commands:
- command: shell.exec
type: test
params:
working_dir: "libbson"
script: "CC='${CC}' MARCH='${MARCH}' CFLAGS='-std=c99 -D_XOPEN_SOURCE=600 -pedantic' RELEASE=1 sh .evergreen/compile.sh"
- name: release-compile-c89
depends_on:
- name: "make-release-archive"
variant: releng
commands:
- command: shell.exec
type: test
params:
working_dir: "libbson"
script: "CC='${CC}' MARCH='${MARCH}' CFLAGS='-std=c89 -D_POSIX_C_SOURCE=200112L' RELEASE=1 sh .evergreen/compile.sh"
#######################################
# Buildvariants #
#######################################
buildvariants:
- name: releng
display_name: "Release Archive Creator"
run_on:
- ubuntu1404-build
tasks:
- name: "make-release-archive"
distros: # Run on any of these variants, whichever will schedule us first
- ubuntu1604-build
- ubuntu1604-test
- ubuntu1404-build
- ubuntu1404-test
- name: "release-compile"
- name: "link-with-cmake"
distros: # Run on any of these variants, whichever will schedule us first
- ubuntu1604-build
- ubuntu1604-test
- ubuntu1404-build
- ubuntu1404-test
- name: "link-with-cmake-windows"
distros:
- windows-64-vs2015-compile
- windows-64-vs2015-test
- name: "link-with-pkg-config"
distros:
- ubuntu1604-build
- ubuntu1604-test
- ubuntu1404-build
- ubuntu1404-test
- name: "debug-compile-valgrind"
distros:
- ubuntu1604-build
- name: "debug-compile-sanitizer-address"
distros:
- ubuntu1604-build
- name: "debug-compile-sanitizer-undefined"
distros:
- ubuntu1604-build
- name: "debug-compile-scan-build"
distros:
- ubuntu1604-build
- name: "debug-compile-coverage"
distros:
- ubuntu1604-build
- ubuntu1604-test
## clang
- name: clang35
display_name: "Debian 8.1 (clang 3.5)"
expansions:
CC: clang
run_on:
- debian81-build
tasks:
- name: "release-compile"
- name: "release-compile-c89"
- name: "release-compile-c99"
- name: "release-compile-c11"
- name: clang37
display_name: "Archlinux (clang 3.7)"
expansions:
CC: clang
run_on:
- archlinux-build
tasks:
- name: "debug-compile"
- name: "debug-compile-c89"
- name: "debug-compile-c99"
- name: "debug-compile-c11"
- name: clang38
display_name: "Ubuntu 16 64 (clang 3.8)"
expansions:
CC: clang
run_on:
- ubuntu1604-build
tasks:
- name: "debug-compile"
- name: "debug-compile-c89"
- name: "debug-compile-c99"
- name: "debug-compile-c11"
## GCC
- name: gcc48
display_name: "RHEL 7.0 64 (GCC 4.8)"
expansions:
CC: gcc
run_on:
- rhel70
tasks:
- name: "debug-compile"
- name: "debug-compile-c99"
- name: "debug-compile-c11"
- name: gcc53
display_name: "Ubuntu 16 64 (GCC 5.3)"
expansions:
CC: gcc
run_on:
- ubuntu1604-build
tasks:
- name: "debug-compile"
- name: "debug-compile-c99"
- name: "debug-compile-c11"
# Other Linuxs
- name: ubuntu-1204-64
display_name: "Ubu 12 gcc-4.6.3 64"
expansions:
CC: gcc
run_on:
- ubuntu1204-test
tasks:
- name: "debug-compile"
- name: "debug-compile-c99"
- name: rhel-55
display_name: "RHEL 5.5 64"
expansions:
CC: gcc
run_on:
- rhel55-test
tasks:
- name: "release-compile"
- name: rhel-62
display_name: "RHEL 6.2 64"
expansions:
CC: gcc
run_on:
- rhel62-test
tasks:
- name: "debug-compile"
- name: "debug-compile-c99"
## ZAP
- name: rhel-72-zseries
display_name: "RHEL 7.2 zSeries"
batchtime: 1440 # 1 day
expansions:
CC: gcc
run_on:
- rhel72-zseries-build
tasks:
- name: "debug-compile"
- name: "debug-compile-c99"
- name: "debug-compile-c11"
- name: rhel-71-power8
display_name: "RHEL 7.1 Power8"
batchtime: 1440 # 1 day
expansions:
CC: gcc
run_on:
- rhel71-power8-test
tasks:
- name: "debug-compile"
- name: "debug-compile-c99"
- name: "debug-compile-c11"
- name: ubuntu1604-power8
batchtime: 1440 # 1 day
display_name: "Ubuntu 16.04 Power8"
expansions:
CC: gcc
run_on:
- rhel71-power8-build
- rhel71-power8-test
tasks:
- name: "debug-compile"
- name: "debug-compile-c99"
- name: "debug-compile-c11"
- name: ubuntu1604-arm64
display_name: "Ubuntu 16.04 ARM64"
batchtime: 1440 # 1 day
expansions:
CC: "gcc"
run_on:
- ubuntu1604-arm64-large
- ubuntu1604-arm64-small
tasks:
- name: "debug-compile"
- name: "debug-compile-c99"
- name: "debug-compile-c11"
## OSX
- name: darwin
display_name: "Darwin, macOS (Apple LLVM)"
expansions:
CC: clang
run_on:
- macos-1012
tasks:
- name: "debug-compile"
- name: "debug-compile-c99"
- name: "debug-compile-c11"
## Windows
- name: windows-32-vs2010
display_name: "Win VS2010 32"
expansions:
CC: "Visual Studio 10 2010"
run_on:
- windows-64-vs2010-compile
tasks:
- name: "release-compile"
- name: windows-64-vs2010
display_name: "Win VS2010 64"
expansions:
CC: "Visual Studio 10 2010 Win64"
run_on:
- windows-64-vs2010-compile
tasks:
- name: "release-compile"
- name: windows-32-vs2013
display_name: "Win VS2013 32"
expansions:
CC: "Visual Studio 12 2013"
run_on:
- windows-64-vs2013-compile
tasks:
- name: "release-compile"
- name: windows-64-vs2013
display_name: "Win VS2013 64"
expansions:
CC: "Visual Studio 12 2013 Win64"
run_on:
- windows-64-vs2013-compile
tasks:
- name: "release-compile"
- name: windows-32-vs2015
display_name: "Win VS2015 32"
expansions:
CC: "Visual Studio 14 2015"
run_on:
- windows-64-vs2015-compile
tasks:
- name: "release-compile"
- name: windows-64-vs2015
display_name: "Win VS2015 64"
expansions:
CC: "Visual Studio 14 2015 Win64"
run_on:
- windows-64-vs2015-compile
tasks:
- name: "release-compile"
- name: windows-64-mingw
display_name: "MinGW-W64 Windows"
expansions:
CC: "mingw"
run_on:
- windows-64-vs2013-compile
tasks:
- name: "debug-compile"
- name: "release-compile"
libbson-1.9.2/.evergreen/link-sample-program.cmd 0000664 0000000 0000000 00000007677 13225757660 0021617 0 ustar 00root root 0000000 0000000 REM Supported/used environment variables:
REM LINK_STATIC Whether to statically link to libbson
rem Ensure Cygwin executables like sh.exe are not in PATH
rem set PATH=C:\Windows\system32;C:\Windows
echo on
echo
set TAR=C:\cygwin\bin\tar
set CMAKE=C:\cmake\bin\cmake
set SRCROOT=%CD%
set BUILD_DIR=%CD%\build-dir
rmdir /S /Q %BUILD_DIR%
mkdir %BUILD_DIR%
set INSTALL_DIR=%CD%\install-dir
rmdir /S /Q %INSTALL_DIR%
mkdir %INSTALL_DIR%
set PATH=%PATH%;"c:\Program Files (x86)\MSBuild\14.0\Bin"
set PATH=%PATH%;"c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin"
set PATH=%PATH%;%INSTALL_DIR%\bin
cd %BUILD_DIR%
%TAR% xf ..\..\libbson.tar.gz -C . --strip-components=1
if "%LINK_STATIC%"=="1" (
%CMAKE% -G "Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DENABLE_TESTS=OFF .
) else (
%CMAKE% -G "Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DENABLE_TESTS=OFF -DENABLE_STATIC=OFF .
)
msbuild.exe /m ALL_BUILD.vcxproj
msbuild.exe INSTALL.vcxproj
echo off
rem Notice that the dll goes in "bin".
set DLL=%INSTALL_DIR%\bin\libbson-1.0.dll
if not exist %DLL% (
echo %DLL% is missing!
exit /B 1
)
rem Shim library around the DLL.
set SHIM=%INSTALL_DIR%\lib\bson-1.0.lib
if not exist %SHIM% (
echo %SHIM% is missing!
exit /B 1
) else (
echo %SHIM% check ok
)
if not exist %INSTALL_DIR%\lib\pkgconfig\libbson-1.0.pc (
echo libbson-1.0.pc missing!
exit /B 1
) else (
echo libbson-1.0.pc check ok
)
if not exist %INSTALL_DIR%\lib\cmake\libbson-1.0\libbson-1.0-config.cmake (
echo libbson-1.0-config.cmake missing!
exit /B 1
) else (
echo libbson-1.0-config.cmake check ok
)
if not exist %INSTALL_DIR%\lib\cmake\libbson-1.0\libbson-1.0-config-version.cmake (
echo libbson-1.0-config-version.cmake missing!
exit /B 1
) else (
echo libbson-1.0-config-version.cmake check ok
)
if "%LINK_STATIC%"=="1" (
if not exist %INSTALL_DIR%\lib\bson-static-1.0.lib (
echo bson-static-1.0.lib missing!
exit /B 1
) else (
echo bson-static-1.0.lib check ok
)
if not exist %INSTALL_DIR%\lib\pkgconfig\libbson-static-1.0.pc (
echo libbson-static-1.0.pc missing!
exit /B 1
) else (
echo libbson-static-1.0.pc check ok
)
if not exist %INSTALL_DIR%\lib\cmake\libbson-static-1.0\libbson-static-1.0-config.cmake (
echo libbson-static-1.0-config.cmake missing!
exit /B 1
) else (
echo libbson-static-1.0-config.cmake check ok
)
if not exist %INSTALL_DIR%\lib\cmake\libbson-static-1.0\libbson-static-1.0-config-version.cmake (
echo libbson-static-1.0-config-version.cmake missing!
exit /B 1
) else (
echo libbson-static-1.0-config-version.cmake check ok
)
) else (
if exist %INSTALL_DIR%\lib\bson-static-1.0.lib (
echo bson-static-1.0.lib should not be installed!
exit /B 1
) else (
echo bson-static-1.0.lib check ok
)
if exist %INSTALL_DIR%\lib\pkgconfig\libbson-static-1.0.pc (
echo libbson-static-1.0.pc should not be installed!
exit /B 1
) else (
echo libbson-static-1.0.pc check ok
)
if exist %INSTALL_DIR%\lib\cmake\libbson-static-1.0\libbson-static-1.0-config.cmake (
echo libbson-static-1.0-config.cmake should not be installed!
exit /B 1
) else (
echo libbson-static-1.0-config.cmake check ok
)
if exist %INSTALL_DIR%\lib\cmake\libbson-static-1.0\libbson-static-1.0-config-version.cmake (
echo libbson-static-1.0-config-version.cmake should not be installed!
exit /B 1
) else (
echo libbson-static-1.0-config-version.cmake check ok
)
)
echo on
cd %SRCROOT%
rem Test our CMake package config file with CMake's find_package command.
set EXAMPLE_DIR=%SRCROOT%\examples\cmake\find_package
if "%LINK_STATIC%"=="1" (
set EXAMPLE_DIR="%EXAMPLE_DIR%_static"
)
cd %EXAMPLE_DIR%
%CMAKE% -G "Visual Studio 14 2015 Win64" -DCMAKE_PREFIX_PATH=%INSTALL_DIR%\lib\cmake .
msbuild.exe ALL_BUILD.vcxproj
rem Yes, they should've named it "dependencies".
dumpbin.exe /dependents Debug\hello_bson.exe
Debug\hello_bson.exe
libbson-1.9.2/.evergreen/link-sample-program.sh 0000664 0000000 0000000 00000012040 13225757660 0021442 0 ustar 00root root 0000000 0000000 #!/bin/sh
set -o xtrace # Write all commands first to stderr
set -o errexit # Exit the script with error if any of the commands fail
# Supported/used environment variables:
# BUILD_LIBBSON_WITH_CMAKE Build libbson with CMake. Default: use Autotools.
# LINK_STATIC Whether to statically link to libbson
# BUILD_SAMPLE_WITH_CMAKE Link program w/ CMake. Default: use pkg-config.
echo "BUILD_LIBBSON_WITH_CMAKE=$BUILD_LIBBSON_WITH_CMAKE LINK_STATIC=$LINK_STATIC BUILD_SAMPLE_WITH_CMAKE=$BUILD_SAMPLE_WITH_CMAKE"
CMAKE=${CMAKE:-/opt/cmake/bin/cmake}
if command -v gtar 2>/dev/null; then
TAR=gtar
else
TAR=tar
fi
if [ $(uname) = "Darwin" ]; then
SO=dylib
LIB_SO=libbson-1.0.0.dylib
LDD="otool -L"
else
SO=so
LIB_SO=libbson-1.0.so.0
LDD=ldd
fi
SRCROOT=`pwd`
BUILD_DIR=$(pwd)/build-dir
rm -rf $BUILD_DIR
mkdir $BUILD_DIR
INSTALL_DIR=$(pwd)/install-dir
rm -rf $INSTALL_DIR
mkdir -p $INSTALL_DIR
cd $BUILD_DIR
$TAR xf ../../libbson.tar.gz -C . --strip-components=1
if [ "$LINK_STATIC" ]; then
if [ "$BUILD_LIBBSON_WITH_CMAKE" ]; then
# Our CMake system builds shared and static by default.
$CMAKE -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DENABLE_TESTS=OFF .
else
./configure --prefix=$INSTALL_DIR --enable-static
fi
make
make install
else
if [ "$BUILD_LIBBSON_WITH_CMAKE" ]; then
# Our CMake system builds shared and static by default.
$CMAKE -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DENABLE_TESTS=OFF -DENABLE_STATIC=OFF .
else
./configure --prefix=$INSTALL_DIR
fi
make
make install
set +o xtrace
if test -f $INSTALL_DIR/lib/libbson-static-1.0.a; then
echo "libbson-static-1.0.a shouldn't have been installed"
exit 1
fi
if test -f $INSTALL_DIR/lib/libbson-1.0.a; then
echo "libbson-1.0.a shouldn't have been installed"
exit 1
fi
if test -f $INSTALL_DIR/lib/pkgconfig/libbson-static-1.0.pc; then
echo "libbson-static-1.0.pc shouldn't have been installed"
exit 1
fi
if test -f $INSTALL_DIR/lib/cmake/libbson-static-1.0/libbson-static-1.0-config.cmake; then
echo "libbson-static-1.0-config.cmake shouldn't have been installed"
exit 1
fi
if test -f $INSTALL_DIR/lib/cmake/libbson-static-1.0/libbson-static-1.0-config-version.cmake; then
echo "libbson-static-1.0-config-version.cmake shouldn't have been installed"
exit 1
fi
fi
set +o xtrace
LIB=$INSTALL_DIR/lib/libbson-1.0.$SO
if test ! -L $LIB; then
echo "$LIB should be a symlink"
exit 1
fi
TARGET=$(readlink $LIB)
if test ! -f $INSTALL_DIR/lib/$TARGET; then
echo "$LIB target $INSTALL_DIR/lib/$TARGET is missing!"
exit 1
else
echo "$LIB target $INSTALL_DIR/lib/$TARGET check ok"
fi
if test ! -f $INSTALL_DIR/lib/$LIB_SO; then
echo "$LIB_SO missing!"
exit 1
else
echo "$LIB_SO check ok"
fi
if test ! -f $INSTALL_DIR/lib/pkgconfig/libbson-1.0.pc; then
echo "libbson-1.0.pc missing!"
exit 1
else
echo "libbson-1.0.pc check ok"
fi
if test ! -f $INSTALL_DIR/lib/cmake/libbson-1.0/libbson-1.0-config.cmake; then
echo "libbson-1.0-config.cmake missing!"
exit 1
else
echo "libbson-1.0-config.cmake check ok"
fi
if test ! -f $INSTALL_DIR/lib/cmake/libbson-1.0/libbson-1.0-config-version.cmake; then
echo "libbson-1.0-config-version.cmake missing!"
exit 1
else
echo "libbson-1.0-config-version.cmake check ok"
fi
if [ "$LINK_STATIC" ]; then
if test ! -f $INSTALL_DIR/lib/libbson-static-1.0.a; then
echo "libbson-static-1.0.a missing!"
exit 1
else
echo "libbson-static-1.0.a check ok"
fi
if test ! -f $INSTALL_DIR/lib/pkgconfig/libbson-static-1.0.pc; then
echo "libbson-static-1.0.pc missing!"
exit 1
else
echo "libbson-static-1.0.pc check ok"
fi
if test ! -f $INSTALL_DIR/lib/cmake/libbson-static-1.0/libbson-static-1.0-config.cmake; then
echo "libbson-static-1.0-config.cmake missing!"
exit 1
else
echo "libbson-static-1.0-config.cmake check ok"
fi
if test ! -f $INSTALL_DIR/lib/cmake/libbson-static-1.0/libbson-static-1.0-config-version.cmake; then
echo "libbson-static-1.0-config-version.cmake missing!"
exit 1
else
echo "libbson-static-1.0-config-version.cmake check ok"
fi
fi
set -o xtrace
cd $SRCROOT
if [ "$BUILD_SAMPLE_WITH_CMAKE" ]; then
# Test our CMake package config file with CMake's find_package command.
EXAMPLE_DIR=$SRCROOT/examples/cmake/find_package
if [ "$LINK_STATIC" ]; then
EXAMPLE_DIR="${EXAMPLE_DIR}_static"
fi
cd $EXAMPLE_DIR
$CMAKE -DCMAKE_PREFIX_PATH=$INSTALL_DIR/lib/cmake .
make
else
# Test our pkg-config file.
export PKG_CONFIG_PATH=$INSTALL_DIR/lib/pkgconfig
cd $SRCROOT/examples
if [ "$LINK_STATIC" ]; then
echo "pkg-config output:"
echo $(pkg-config --libs --cflags libbson-static-1.0)
sh compile-with-pkg-config-static.sh
else
echo "pkg-config output:"
echo $(pkg-config --libs --cflags libbson-1.0)
sh compile-with-pkg-config.sh
fi
fi
if [ ! "$LINK_STATIC" ]; then
if [ $(uname) = "Darwin" ]; then
export DYLD_LIBRARY_PATH=$INSTALL_DIR/lib
else
export LD_LIBRARY_PATH=$INSTALL_DIR/lib
fi
fi
echo "ldd hello_bson:"
$LDD hello_bson
./hello_bson
libbson-1.9.2/.evergreen/llvm-gcov.sh 0000775 0000000 0000000 00000000044 13225757660 0017473 0 ustar 00root root 0000000 0000000 #!/bin/bash
exec llvm-cov gcov "$@"
libbson-1.9.2/.evergreen/man-page-image-list.sh 0000664 0000000 0000000 00000001244 13225757660 0021303 0 ustar 00root root 0000000 0000000 #!/bin/sh
# Make index.html of all man page images so we can see them in Evergreen.
echo "
Man Page Images
"
for path in $1/*.png; do
png=$(basename $path)
case "$png" in
# These pages include all others, CDRIVER-2035
bson_api.3.png)
continue
;;
bson_index.3.png)
continue
;;
*)
echo "
${png}

"
;;
esac
done
echo ""
libbson-1.9.2/.gitattributes 0000664 0000000 0000000 00000000105 13225757660 0016057 0 ustar 00root root 0000000 0000000 *.txt text
*.vcproj eol=crlf
*.sh eol=lf
libbson-1.9.2/.gitignore 0000664 0000000 0000000 00000001341 13225757660 0015157 0 ustar 00root root 0000000 0000000 *~
*.a
aclocal.m4
AUTHORS
autom4te.cache
bcon-col-view
bcon-speed
bson-streaming-reader
bson-metrics
bson-to-json
bson-validate
ChangeLog
CMakeFiles
CMakeCache.txt
compile
config.*
!config.yml
configure
depcomp
.deps
.dirstamp
*.exe
INSTALL
install-sh
json-to-bson
*.la
.libs
libtool
libbson-1.0.so*
*.lo
ltmain.sh
Makefile
Makefile.in
missing
*.o
*.pc
README
stamp-h1
*.swp
test-libbson
test.log
test-results.json
.DS_Store
xcuserdata
tags
.lvimrc
doc/installing.page
doc/version.page
.coverage.lcov
coverage
*.gcda
*.gcno
CPackConfig.cmake
CPackSourceConfig.cmake
CTestTestfile.cmake
cmake_install.cmake
libbson-1.0-config-version.cmake
libbson-1.0-config.cmake
libbson-static-1.0-config-version.cmake
libbson-static-1.0-config.cmake
libbson-1.9.2/.travis.yml 0000664 0000000 0000000 00000000251 13225757660 0015277 0 ustar 00root root 0000000 0000000 language: c
compiler:
- gcc
- clang
env:
- CFLAGS="$CFLAGS -Werror -Wno-cast-align"
script:
- ./autogen.sh --enable-maintainer-flags
- make
- make test
libbson-1.9.2/CMakeLists.txt 0000664 0000000 0000000 00000031071 13225757660 0015732 0 ustar 00root root 0000000 0000000 cmake_minimum_required(VERSION 3.1)
set (MESSAGES_ENABLED 1)
function(message)
list (GET ARGV 0 MessageType)
if (MESSAGES_ENABLED)
list (REMOVE_AT ARGV 0)
_message (${MessageType} "${ARGV}")
endif()
endfunction()
project (libbson C)
set(ENABLE_STATIC AUTO CACHE STRING "Build static libbson. Set to ON/AUTO/OFF, default AUTO.")
option(ENABLE_TESTS "Build libbson tests." ON)
option(ENABLE_EXAMPLES "Build libbson examples." OFF)
option(ENABLE_MAINTAINER_FLAGS "Use strict compiler checks" OFF)
if (ENABLE_STATIC STREQUAL ON OR ENABLE_STATIC STREQUAL AUTO)
# In the future we may need to check whether static dependencies are
# available. For now, AUTO means ON.
set (BSON_ENABLE_STATIC ON)
endif ()
if (ENABLE_TESTS AND NOT BSON_ENABLE_STATIC)
message (FATAL_ERROR "-DENABLE_STATIC=OFF also requires -DENABLE_TESTS=OFF")
endif ()
if (NOT WIN32)
message(WARNING "CMake support is experimental and may not produce production quality artifacts")
endif ()
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckStructHasMember)
include(CheckSymbolExists)
include(TestBigEndian)
include(InstallRequiredSystemLibraries)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/build/cmake)
# Set BSON_MAJOR_VERSION, BSON_MINOR_VERSION, etc.
include(LoadVersion)
LoadVersion(${PROJECT_SOURCE_DIR}/VERSION_CURRENT BSON)
LoadVersion(${PROJECT_SOURCE_DIR}/VERSION_RELEASED BSON_RELEASED)
message("Current version (from VERSION_CURRENT file): ${BSON_VERSION}")
if (NOT ${BSON_VERSION} STREQUAL ${BSON_RELEASED_VERSION})
message("Previous release (from VERSION_RELEASED file): ${BSON_RELEASED_VERSION}")
endif()
set (SOURCE_DIR "${PROJECT_SOURCE_DIR}/")
set (BSON_API_VERSION 1.0)
set (CPACK_RESOURCE_FILE_LICENSE "${SOURCE_DIR}/COPYING")
set (CPACK_PACKAGE_VERSION_MAJOR ${BSON_MAJOR_VERSION})
set (CPACK_PACKAGE_VERSION_MINOR ${BSON_MINOR_VERSION})
include (CPack)
TEST_BIG_ENDIAN(BSON_BIG_ENDIAN)
# These need proper checks like automake.
set (BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES 0)
#librt needed on linux for clock_gettime
find_library(RT_LIBRARY rt)
if (RT_LIBRARY)
#set required libraries for CHECK_FUNCTION_EXISTS
set(CMAKE_REQUIRED_LIBRARIES ${RT_LIBRARY})
set(BSON_LIBS ${BSON_LIBS} ${RT_LIBRARY})
endif()
# See https://public.kitware.com/Bug/view.php?id=15659
CHECK_SYMBOL_EXISTS(snprintf stdio.h BSON_HAVE_SNPRINTF)
if (NOT BSON_HAVE_SNPRINTF)
set(BSON_HAVE_SNPRINTF 0)
else ()
set(BSON_HAVE_SNPRINTF 1)
endif ()
CHECK_FUNCTION_EXISTS(reallocf BSON_HAVE_REALLOCF)
if (NOT BSON_HAVE_REALLOCF)
set(BSON_HAVE_REALLOCF 0)
endif ()
CHECK_STRUCT_HAS_MEMBER("struct timespec" tv_sec time.h BSON_HAVE_TIMESPEC)
if (NOT BSON_HAVE_TIMESPEC)
message(STATUS " no timespec struct")
set(BSON_HAVE_TIMESPEC 0)
else ()
message(STATUS " struct timespec found")
set(BSON_HAVE_TIMESPEC 1)
endif ()
CHECK_SYMBOL_EXISTS(gmtime_r time.h BSON_HAVE_GMTIME_R)
if (NOT BSON_HAVE_GMTIME_R)
set(BSON_HAVE_GMTIME_R 0)
else ()
set(BSON_HAVE_GMTIME_R 1)
endif ()
CHECK_FUNCTION_EXISTS(rand_r BSON_HAVE_RAND_R)
if (NOT BSON_HAVE_RAND_R)
set(BSON_HAVE_RAND_R 0)
else ()
set(BSON_HAVE_RAND_R 1)
endif ()
if (WIN32)
set (BSON_OS 2)
else ()
set (BSON_OS 1)
endif ()
if (MSVC)
set (BSON_HAVE_CLOCK_GETTIME 0)
set (BSON_HAVE_STDBOOL_H 0)
set (BSON_HAVE_STRNLEN 0)
set (BSON_EXTRA_ALIGN 1)
set (BSON_HAVE_SYSCALL_TID 0)
else ()
CHECK_FUNCTION_EXISTS(clock_gettime BSON_HAVE_CLOCK_GETTIME)
if (NOT BSON_HAVE_CLOCK_GETTIME)
set(BSON_HAVE_CLOCK_GETTIME 0)
endif ()
CHECK_FUNCTION_EXISTS(strnlen BSON_HAVE_STRNLEN)
if (NOT BSON_HAVE_STRNLEN)
set(BSON_HAVE_STRNLEN 0)
endif ()
CHECK_INCLUDE_FILE(stdbool.h BSON_HAVE_STDBOOL_H)
if (NOT BSON_HAVE_STDBOOL_H)
set(BSON_HAVE_STDBOOL_H 0)
endif ()
set (BSON_EXTRA_ALIGN 1)
CHECK_SYMBOL_EXISTS(SYS_gettid sys/syscall.h BSON_HAVE_SYSCALL_TID)
if (NOT BSON_HAVE_SYSCALL_TID OR APPLE OR ANDROID)
set (BSON_HAVE_SYSCALL_TID 0)
endif ()
CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
endif ()
set (BSON_HAVE_ATOMIC_32_ADD_AND_FETCH 1)
set (BSON_HAVE_ATOMIC_64_ADD_AND_FETCH 1)
if (BSON_BIG_ENDIAN)
set (BSON_BYTE_ORDER 4321)
else ()
set (BSON_BYTE_ORDER 1234)
endif ()
configure_file (
"${SOURCE_DIR}/src/bson/bson-config.h.in"
"${PROJECT_BINARY_DIR}/src/bson/bson-config.h"
)
configure_file (
"${SOURCE_DIR}/src/bson/bson-version.h.in"
"${PROJECT_BINARY_DIR}/src/bson/bson-version.h"
)
configure_file (
"${PROJECT_SOURCE_DIR}/build/cmake/bson/bson-stdint.h"
"${PROJECT_BINARY_DIR}/src/bson/bson-stdint.h"
)
include_directories("${PROJECT_BINARY_DIR}/src/bson")
include_directories("${SOURCE_DIR}/src/bson")
include_directories("${SOURCE_DIR}/src")
if (APPLE)
cmake_policy(SET CMP0042 OLD)
endif()
include (MaintainerFlags)
set (SOURCES
${SOURCE_DIR}/src/bson/bcon.c
${SOURCE_DIR}/src/bson/bson.c
${SOURCE_DIR}/src/bson/bson-atomic.c
${SOURCE_DIR}/src/bson/bson-clock.c
${SOURCE_DIR}/src/bson/bson-context.c
${SOURCE_DIR}/src/bson/bson-decimal128.c
${SOURCE_DIR}/src/bson/bson-error.c
${SOURCE_DIR}/src/bson/bson-iso8601.c
${SOURCE_DIR}/src/bson/bson-iter.c
${SOURCE_DIR}/src/bson/bson-json.c
${SOURCE_DIR}/src/bson/bson-keys.c
${SOURCE_DIR}/src/bson/bson-md5.c
${SOURCE_DIR}/src/bson/bson-memory.c
${SOURCE_DIR}/src/bson/bson-oid.c
${SOURCE_DIR}/src/bson/bson-reader.c
${SOURCE_DIR}/src/bson/bson-string.c
${SOURCE_DIR}/src/bson/bson-timegm.c
${SOURCE_DIR}/src/bson/bson-utf8.c
${SOURCE_DIR}/src/bson/bson-value.c
${SOURCE_DIR}/src/bson/bson-version-functions.c
${SOURCE_DIR}/src/bson/bson-writer.c
${SOURCE_DIR}/src/jsonsl/jsonsl.c
)
set (HEADERS
${PROJECT_BINARY_DIR}/src/bson/bson-config.h
${PROJECT_BINARY_DIR}/src/bson/bson-stdint.h
${PROJECT_BINARY_DIR}/src/bson/bson-version.h
${SOURCE_DIR}/src/bson/bcon.h
${SOURCE_DIR}/src/bson/bson-atomic.h
${SOURCE_DIR}/src/bson/bson-clock.h
${SOURCE_DIR}/src/bson/bson-compat.h
${SOURCE_DIR}/src/bson/bson-context.h
${SOURCE_DIR}/src/bson/bson-decimal128.h
${SOURCE_DIR}/src/bson/bson-endian.h
${SOURCE_DIR}/src/bson/bson-error.h
${SOURCE_DIR}/src/bson/bson.h
${SOURCE_DIR}/src/bson/bson-iter.h
${SOURCE_DIR}/src/bson/bson-json.h
${SOURCE_DIR}/src/bson/bson-keys.h
${SOURCE_DIR}/src/bson/bson-macros.h
${SOURCE_DIR}/src/bson/bson-md5.h
${SOURCE_DIR}/src/bson/bson-memory.h
${SOURCE_DIR}/src/bson/bson-oid.h
${SOURCE_DIR}/src/bson/bson-reader.h
${SOURCE_DIR}/src/bson/bson-stdint-win32.h
${SOURCE_DIR}/src/bson/bson-string.h
${SOURCE_DIR}/src/bson/bson-types.h
${SOURCE_DIR}/src/bson/bson-utf8.h
${SOURCE_DIR}/src/bson/bson-value.h
${SOURCE_DIR}/src/bson/bson-version-functions.h
${SOURCE_DIR}/src/bson/bson-writer.h
)
add_library(bson_shared SHARED ${SOURCES} ${HEADERS})
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set_target_properties(bson_shared PROPERTIES COMPILE_DEFINITIONS "BSON_COMPILATION;JSONSL_PARSE_NAN")
# CMake wants to make different symlinks than the Autotools, see
# https://cmake.org/pipermail/cmake/2007-September/016501.html
# This hack sets up standard symlink, libbson-1.0.so -> libbson-1.0.0.so
set_target_properties(bson_shared PROPERTIES VERSION 0 SOVERSION ${BSON_MAJOR_VERSION})
set_target_properties(bson_shared PROPERTIES OUTPUT_NAME "bson-${BSON_API_VERSION}" PREFIX "lib")
if (RT_LIBRARY)
target_link_libraries (bson_shared ${RT_LIBRARY})
endif()
find_library(M_LIBRARY m)
if (M_LIBRARY)
target_link_libraries (bson_shared ${M_LIBRARY})
set(BSON_LIBS ${BSON_LIBS} ${M_LIBRARY})
endif()
set(THREADS_PREFER_PTHREAD_FLAG 1)
find_package (Threads REQUIRED)
target_link_libraries(bson_shared Threads::Threads)
if(CMAKE_USE_PTHREADS_INIT)
set(BSON_LIBS ${BSON_LIBS} ${CMAKE_THREAD_LIBS_INIT})
endif()
if (NOT UNIX)
# gethostbyname
target_link_libraries (bson_shared ws2_32)
# Can't find_library () system dependencies
# must be handled specially since we can't resolve them
set(BSON_SYSTEM_LIBS ${BSON_SYSTEM_LIBS} ws2_32)
endif()
if (BSON_ENABLE_STATIC)
add_library(bson_static STATIC ${SOURCES} ${HEADERS})
set_target_properties(bson_static PROPERTIES COMPILE_DEFINITIONS "BSON_COMPILATION;BSON_STATIC;JSONSL_PARSE_NAN")
set_target_properties(bson_static PROPERTIES VERSION ${BSON_VERSION})
set_target_properties(bson_static PROPERTIES OUTPUT_NAME "bson-static-${BSON_API_VERSION}")
target_link_libraries(bson_static Threads::Threads)
if (RT_LIBRARY)
target_link_libraries (bson_static ${RT_LIBRARY})
endif()
if (M_LIBRARY)
target_link_libraries (bson_static ${M_LIBRARY})
endif()
if (NOT UNIX)
# gethostbyname
target_link_libraries (bson_static ws2_32)
endif ()
endif ()
if (ENABLE_TESTS)
enable_testing()
add_definitions("-DBINARY_DIR=\"${SOURCE_DIR}/tests/binary\"")
add_definitions("-DJSON_DIR=\"${SOURCE_DIR}/tests/json\"")
set (BSON_TEST_SOURCES
${SOURCE_DIR}/tests/corpus-test.c
${SOURCE_DIR}/tests/corpus-test.h
${SOURCE_DIR}/tests/TestSuite.c
${SOURCE_DIR}/tests/TestSuite.h
${SOURCE_DIR}/tests/test-libbson.c
${SOURCE_DIR}/tests/test-atomic.c
${SOURCE_DIR}/tests/test-bson.c
${SOURCE_DIR}/tests/test-bson-corpus.c
${SOURCE_DIR}/tests/test-endian.c
${SOURCE_DIR}/tests/test-clock.c
${SOURCE_DIR}/tests/test-decimal128.c
${SOURCE_DIR}/tests/test-error.c
${SOURCE_DIR}/tests/test-iso8601.c
${SOURCE_DIR}/tests/test-iter.c
${SOURCE_DIR}/tests/test-json.c
${SOURCE_DIR}/tests/test-oid.c
${SOURCE_DIR}/tests/test-reader.c
${SOURCE_DIR}/tests/test-string.c
${SOURCE_DIR}/tests/test-utf8.c
${SOURCE_DIR}/tests/test-value.c
${SOURCE_DIR}/tests/test-version.c
${SOURCE_DIR}/tests/test-writer.c
${SOURCE_DIR}/tests/test-bcon-basic.c
${SOURCE_DIR}/tests/test-bcon-extract.c
${SOURCE_DIR}/tests/json-test.c
${SOURCE_DIR}/tests/json-test.c
${SOURCE_DIR}/tests/json-test.h
)
add_executable (test-libbson ${BSON_TEST_SOURCES})
target_link_libraries(test-libbson bson_shared bson_static)
add_test(NAME test-libbson COMMAND test-libbson)
file(COPY ${SOURCE_DIR}/tests/binary ${SOURCE_DIR}/tests/json
DESTINATION ${PROJECT_BINARY_DIR}/tests)
endif () # ENABLE_TESTS
function (add_example bin src)
set (BSON_EXAMPLE_SOURCES ${SOURCE_DIR}/${src})
add_executable (${bin} ${BSON_EXAMPLE_SOURCES})
# Link against the shared lib like normal apps
target_link_libraries(${bin} bson_shared)
set (EXAMPLES ${EXAMPLES} ${bin})
endfunction ()
if (ENABLE_EXAMPLES)
add_example (bcon-col-view examples/bcon-col-view.c)
add_example (bcon-speed examples/bcon-speed.c)
add_example (bson-metrics examples/bson-metrics.c)
# Uses getopt ()
#add_example (bson-streaming-reader examples/bson-streaming-reader.c)
add_example (bson-to-json examples/bson-to-json.c)
add_example (bson-validate examples/bson-validate.c)
add_example (json-to-bson examples/json-to-bson.c)
endif () # ENABLE_EXAMPLES
set (BSON_HEADER_INSTALL_DIR "include/libbson-${BSON_API_VERSION}")
install(
TARGETS bson_shared ${EXAMPLES}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
)
if (BSON_ENABLE_STATIC)
install(
TARGETS bson_static ${EXAMPLES}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
)
endif ()
install(
FILES ${HEADERS}
DESTINATION ${BSON_HEADER_INSTALL_DIR}
)
set(LIBBSON_LIBS "")
foreach(_lib ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${BSON_LIBS})
if(_lib MATCHES ".*/.*" OR _lib MATCHES "^-")
set(LIBBSON_LIBS "${LIBBSON_LIBS} ${_lib}")
else()
set(LIBBSON_LIBS "${LIBBSON_LIBS} -l${_lib}")
endif()
endforeach()
# System dependencies don't match the above regexs, but also don't want the -l
foreach(_lib ${BSON_SYSTEM_LIBS})
set(LIBBSON_LIBS "${LIBBSON_LIBS} ${_lib}")
endforeach()
set(VERSION "${BSON_VERSION}")
set(prefix "${CMAKE_INSTALL_PREFIX}")
set(libdir "\${prefix}/lib")
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/src/libbson-1.0.pc.in
${CMAKE_CURRENT_BINARY_DIR}/src/libbson-1.0.pc
@ONLY)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/src/libbson-1.0.pc
DESTINATION
lib/pkgconfig
)
if (BSON_ENABLE_STATIC)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/src/libbson-static-1.0.pc.in
${CMAKE_CURRENT_BINARY_DIR}/src/libbson-static-1.0.pc
@ONLY)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/src/libbson-static-1.0.pc
DESTINATION
lib/pkgconfig
)
endif ()
include (build/cmake/BSONPackage.cmake)
libbson-1.9.2/COPYING 0000664 0000000 0000000 00000026136 13225757660 0014233 0 ustar 00root root 0000000 0000000
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
libbson-1.9.2/Makefile.am 0000664 0000000 0000000 00000006245 13225757660 0015233 0 ustar 00root root 0000000 0000000 EXTRA_DIST =
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
bin_PROGRAMS =
lib_LTLIBRARIES =
noinst_LTLIBRARIES =
noinst_PROGRAMS =
include src/Makefile.am
include doc/Makefile.am
if ENABLE_MAN_PAGES
include doc/man/Makefile.am
endif
if ENABLE_HTML_DOCS
include doc/html/Makefile.am
endif
if ENABLE_TESTS
include tests/Makefile.am
endif
if ENABLE_EXAMPLES
include examples/Makefile.am
endif
# for various extra dist
include build/Makefile.am
ACLOCAL_AMFLAGS = -I build/autotools/m4 ${ACLOCAL_FLAGS}
DISTCHECK_CONFIGURE_FLAGS = --enable-maintainer-flags --enable-silent-rules --enable-optimizations --enable-html-docs --enable-man-pages
bsondocdir = ${docdir}
bsondoc_DATA = \
COPYING \
NEWS \
README \
THIRD_PARTY_NOTICES
EXTRA_DIST += $(bsondoc_DATA)
EXTRA_DIST += CMakeLists.txt \
VERSION_CURRENT \
VERSION_RELEASED
dist-hook:
@if test -d "$(srcdir)/.git"; then \
(cd "$(srcdir)" && \
$(top_srcdir)/build/autotools/missing --run git log --stat ) > ChangeLog.tmp \
&& mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
|| (rm -f ChangeLog.tmp; \
echo Failed to generate ChangeLog >&2); \
else \
echo A git checkout is required to generate a ChangeLog >&2; \
fi
# Make libbson-static-1.0.a symlink to libbson-1.0.a. If libbson is built with
# CMake instead of the Autotools, the static archive is named
# libbson-static-1.0.a by default. For the sake of projects that want to
# statically link to libbson, ensure the static archive is present with the
# name no matter how it was built.
# Also, copy CMake config-file packages to lib/cmake/ for use with CMake's
# "find_package" command.
if ENABLE_STATIC
enable_static=1
endif
install-exec-hook:
$(MKDIR_P) $(DESTDIR)$(libdir)/cmake/libbson-1.0
cp -f build/cmake/libbson-1.0-config.cmake $(DESTDIR)$(libdir)/cmake/libbson-1.0
cp -f build/cmake/libbson-1.0-config-version.cmake $(DESTDIR)$(libdir)/cmake/libbson-1.0
if [ ! -z "$(enable_static)" ]; then \
rm -rf $(DESTDIR)$(libdir)/cmake/libbson-static-1.0; \
$(MKDIR_P) $(DESTDIR)$(libdir)/cmake/libbson-static-1.0; \
cd $(DESTDIR)$(libdir); \
rm -f libbson-static-1.0.a; \
$(LN_S) libbson-1.0.a libbson-static-1.0.a; \
cp -f $(abs_builddir)/build/cmake/libbson-static-1.0-config.cmake cmake/libbson-static-1.0; \
cp -f $(abs_builddir)/build/cmake/libbson-static-1.0-config-version.cmake cmake/libbson-static-1.0; \
fi
clean-local:
-rm -rf $(CLEANFILES)
uninstall-local:
-rm -r $(bsondocdir)
-rm -rf $(DESTDIR)$(libdir)/libbson-static-1.0.a
-rm -rf $(DESTDIR)$(libdir)/cmake/libbson-1.0
-rm -rf $(DESTDIR)$(libdir)/cmake/libbson-static-1.0
libbson-1.9.2/NEWS 0000664 0000000 0000000 00000075356 13225757660 0013707 0 ustar 00root root 0000000 0000000 Libbson-1.9.2
=============
It is my pleasure to announce Libbson-1.9.2. This release completes reverting a
changed macro definition that broke API compatibility. The revert in 1.9.1 did
not completely fix the BC break. Thanks to Petr PÃsaÅ™ for finding and fixing the
mistake.
Peace,
A. Jesse Jiryu Davis
Libbson-1.9.1
=============
It is my pleasure to announce Libbson-1.9.1. This release reverts a changed
macro definition that broke API compatibility, and fixes an off-by-one error
in bson_append_regex that resulted in corrupt BSON.
Thanks to everyone who contributed to the development of this release.
* A. Jesse Jiryu Davis
* Derick Rethans
Peace,
A. Jesse Jiryu Davis
1.9.0
=====
It is my pleasure to announce Libbson-1.9.0.
New features and bugfixes:
* Fix Autotools syntax for OpenBSD and any platform lacking stdint.h.
* Fix Android NDK incompatibilities.
* Fix a one-byte write past the end of a buffer in bson_decimal128_to_string.
* Avoid reading past the end of a string that contains UTF-8 multibyte NIL.
* Fix some pedantic warnings in C99 mode.
Thanks to everyone who contributed to the development of this release.
* A. Jesse Jiryu Davis
* Kevin Albertson
* Jean-Marc Le Roux
* Jeremy Mikola
* Dimitri Gence
* Hannes Magnusson
Peace,
A. Jesse Jiryu Davis
Libbson-1.8.2
=============
No change since 1.8.1; released to keep pace with libmongoc's version.
-- A. Jesse Jiryu Davis
Libbson-1.8.1
=============
It is my pleasure to announce libbson-1.8.1. This release removes a syntax
error in the configure script that affects some shells, and fixes the encoding
of this NEWS file.
Thanks to everyone who contributed to the development of this release.
* A. Jesse Jiryu Davis
* Jeremy Mikola
Peace,
A. Jesse Jiryu Davis
Libbson-1.8.0
=============
It is my pleasure to announce Libbson-1.8.0.
New features and bugfixes:
* Make symbols bson_get_major_version, bson_get_minor_version,
bson_get_micro_version, bson_get_version, and bson_check_version available
to C++ programs.
* New CMake option ENABLE_MAINTAINER_FLAGS.
* Crash iterating over invalid code with scope.
Thanks to everyone who contributed to the development of this release.
* A. Jesse Jiryu Davis
* Hannes Magnusson
* Jeremy Mikola
* Kevin Albertson
* Michael Kuhn
Peace,
A. Jesse Jiryu Davis
Libbson-1.7.0
=============
* Changes to JSON encoding and decoding:
* New functions bson_as_canonical_extended_json and
bson_as_relaxed_extended_json convert BSON to canonical and relaxed
extended JSON according to MongoDB Extended JSON Spec.
Output for the existing bson_as_json function has not been changed.
* When parsing JSON type wrappers like "$timestamp", any missing or extra
keys are an error.
* The JSON format for BSON regular expressions is now "$regularExpression":
{"pattern": "...", "options": "..."}. The old format {"$regex": "...",
"$options": "..."} is still parsed.
* The JSON format for BSON binary elements is now "$binary": {"base64":
"...", "subType": "..."}. The old format {"$binary": "...", "$type":
"..."} is still parsed.
* BSON dates can be parsed from "$date" as an ISO8601 date or "$numberLong"
as milliseconds since the epoch: "t": {"$date": {"$numberLong": "1234"}}.
Dates can no longer be formatted as raw integers. bson_as_json writes a
BSON date after 1970 as "$date" with an ISO8601 string, and dates before
1970 as negative milliseconds wrapped in "$numberLong".
bson_as_canonical_extended_json always writes dates with "$numberLong".
bson_as_relaxed_extended_json always writes dates with "$date".
* The non-numbers NaN, Infinity, and -Infinity are now recognized (regardless
of case) when parsing JSON.
* CMake build now installs .pc files for programs that link to libbson using
pkg-config. Both the CMake and Autotools build systems now install .cmake
files for programs that link to libbson using CMake. Linking to libbson
statically or dynamically is now much more convenient.
* New CMake option, "ENABLE_STATIC", defaults to ON.
* Minimum required CMake version has been increased to 3.1.
* CMake remains experimental on non-Windows platforms and issues a warning now
* New functions
* bson_strcasecmp, a portable equivalent of strcasecmp.
* bson_iter_as_double, cast the current value to double.
* bson_iter_init_from_data, creates an iterator from BSON string.
* bson_validate_with_error, checks a document like bson_validate does but
also reports which key was invalid
* New convenience macros
* BSON_ITER_HOLDS_INT, checks if iterator holds int32 or int64
* BSON_ITER_HOLDS_NUMBER, checks if iterator holds int32, int64 or double
* Raised BSON recursion limit to 200
Libbson-1.6.0
=============
It is my pleasure to announce libbson-1.6.0.
New features and bug fixes:
* Use jsonsl instead of libyajl as our JSON parsing library, parse JSON more
strictly, fix minor parsing bugs.
* Extended JSON documents like '{"$code": "...", "$scope": {}}' are now parsed
into BSON "code" elements.
* ISO8601 dates now allow years from 0000 to 9999 inclusive. Before, years
before 1970 were prohibited.
* BSON floats and ints are now distinguished in JSON output.
* The library is now built and continuously tested with MinGW-W64 on Windows.
* The documentation is ported from Mallard XML to ReStructured Text, the
HTML documentation is restyled, and numerous man page syntax errors fixed.
* All public functions now have the __cdecl calling convention on Windows.
Thanks to everyone who contributed to the development of this release.
* A. Jesse Jiryu Davis
* Hannes Magnusson
* Aleksander Melnikov
* Remi Collet
Peace,
A. Jesse Jiryu Davis
libbson-1.5.5
=============
No change since 1.5.4; released to keep pace with libmongoc's version.
-- A. Jesse Jiryu Davis
Libbson-1.5.4
=============
No change since 1.5.3; released to keep pace with libmongoc's version.
-- A. Jesse Jiryu Davis
Libbson-1.5.3
=============
No change since 1.5.2; released to keep pace with libmongoc's version.
-- A. Jesse Jiryu Davis
Libbson-1.5.2
=============
This is a patch release that fixes a build error with MinGW on Windows.
Libbson-1.5.1
=============
No change since 1.5.0; released to keep pace with libmongoc's version.
-- A. Jesse Jiryu Davis
Libbson-1.5.2
=============
It is my pleasure to announce Libbson-1.5.2.
New bug fixes:
* CDRIVER-1982 fix ifdef for strerror_s with mingw.
Thanks to everyone who contributed to the development of this release.
* A. Jesse Jiryu Davis
Peace,
Hannes Magnusson
Libbson-1.5.1
=============
No change since 1.5.0; released to keep pace with libmongoc's version.
-- A. Jesse Jiryu Davis
Libbson-1.5.0
=============
It is my pleasure to announce Libbson-1.5.0.
New features and bug fixes:
* New BSON Type, Decimal128 (bson_decimal128_t) along with the following
new functions and helpers:
* bson_decimal128_to_string()
* bson_decimal128_from_string()
* bson_iter_decimal128()
* bson_iter_overwrite_decimal128()
* BSON_ITER_HOLDS_DECIMAL128()
* bson_append_decimal128()
* BSON_APPEND_DECIMAL128()
* BCON_DECIMAL128()
See the documentations for further details.
* bson_validate and bson_iter_next now validate that BSON boolean values are
0 or 1. Before, any non-zero value was considered true.
* bson_append_code_with_scope now preserves the "code with scope" type
if scope is an empty, non-NULL BSON document.
* BSON "code" and "code with scope" types are properly translated to and from
JSON of the form '{"$code": "...", "$scope": {...}}'.
* bson_json_reader functions now always validate UTF-8.
* JSON parsing now preserves integer width.
* bson_strtoll now matches stroll: it detects range errors, and when
parsing octal it stops at non-octal digits and returns what it parsed
instead of setting errno.
* New flag BSON_VALIDATE_EMPTY_KEYS causes bson_validate to fail if a document
contains zero-length field names.
* The configure option "--enable-hardening" had had no effect. It is removed
in favor of system-wide compiler configuration.
Thanks to everyone who contributed to the development of this release.
* Hannes Magnusson
* A. Jesse Jiryu Davis
* Fiona Rowan
* Brian Samek
Peace,
A. Jesse Jiryu Davis
Libbson-1.4.1
=============
This release improves the HTML documentation's Makefile.
-- A. Jesse Jiryu Davis
Libbson-1.4.0
=============
It is my pleasure to announce Libbson-1.4.0.
New features and bug fixes:
* bson_reader_reset seeks to the beginning of a BSON buffer.
* bson_steal efficiently transfers contents from one bson_t to another.
* Fix Windows compile error with BSON_EXTRA_ALIGN disabled.
* Potential buffer overrun in bson_strndup.
* bson_oid_to_string optimization for MS Visual Studio
* bson_oid_is_valid accepts uppercase hex characters.
* bson_json_reader_read aborted on some invalid Extended JSON documents.
* All man page names now begin with "bson_" to avoid install conflicts.
* Error messages sometimes truncated at 63 chars.
This release tentatively supports the new BSON decimal type when built with
"./configure --enable-experimental-features", or with
"cmake -DENABLE_EXPERIMENTAL_FEATURES=ON", but this feature may change
between now and libbson 1.5.
Thanks to everyone who contributed to the development of this release.
* A. Jesse Jiryu Davis
* Hannes Magnusson
* Jeremy Mikola
* David Hatch
* Ian Boros
* Fiona Rowan
* Shane Harvey
* Runar Buvik
* Raymond Jacobson
* ReadmeCritic
* Mike Lloyd
* Derick Rethans
* Maverick Chan
Peace,
A. Jesse Jiryu Davis
Libbson-1.3.5
=============
No change since 1.3.4; released to keep pace with libmongoc's version.
-- A. Jesse Jiryu Davis
Libbson-1.3.4
=============
No change since 1.3.3; released to keep pace with libmongoc's version.
-- A. Jesse Jiryu Davis
Libbson-1.3.3
=============
No change since 1.3.2; released to keep pace with libmongoc's version.
-- A. Jesse Jiryu Davis
Libbson-1.3.2
=============
This is a patch release with a fix for the build system:
* man pages couldn't be built from a distribution tarball.
Peace,
A. Jesse Jiryu Davis
Libbson-1.3.1
=============
It is my pleasure to announce Libbson-1.3.1. This is a bugfix release:
* bson_strnlen is off by one on Windows.
* BSON_HAVE_STRNLEN config check used incorrectly.
* Incompatibility with older CMake versions.
* Wrong-sized allocation in bson_json_reader_new.
Thanks to everyone who contributed to the development of this release.
* A. Jesse Jiryu Davis
* Alex Bishop
* Jeroen Ooms
Peace,
A. Jesse Jiryu Davis
Libbson-1.3.0
=============
It is my pleasure to announce to you the release of Libbson-1.3.0. Since the
release candidate 1.3.0-rc0, the only changes have been fixes for compiler
warnings and errors on various platforms.
All changes since the previous stable release, 1.2.1:
* Fix potential crash in bson_strncpy on Windows.
* Parse DBRefs correctly from JSON.
* CMake option to disable building tests: "cmake -DENABLE_TESTS:BOOL=OFF".
* Refactor the build system to declare library version in one place.
* Fix compiler warnings and errors, especially with Visual Studio 2015
and IBM XL C.
* Combine environment's CFLAGS with configure options when building.
Thanks to everyone who contributed to the development of this release.
* A. Jesse Jiryu Davis
* Hannes Magnusson
* Mark Benvenuto
* Petr PÃsaÅ™
* xpol
* Jose Sebastian Battig
* Jeroen Ooms
Peace,
A. Jesse Jiryu Davis
Libbson-1.3.0-rc0
=================
It is my pleasure to announce to you first release candidate of Libbson-1.3.0.
Changes since 1.3.0-beta0:
* Parse DBRefs correctly from JSON.
* CMake option to disable building tests: "cmake -DENABLE_TESTS:BOOL=OFF".
* Fix build warnings on some platforms, and refactor the build system.
Thanks to everyone who contributed to the development of this release.
* A. Jesse Jiryu Davis
* Hannes Magnusson
* Jose Sebastian Battig
Peace,
A. Jesse Jiryu Davis
Libbson-1.3.0-beta0
===================
It is my pleasure to announce to you the beta release of Libbson-1.3.0.
Changes since the previous stable release, 1.2.1:
* Fix potential crash in bson_strncpy on Windows.
* Fix compiler warnings and errors, especially with Visual Studio 2015
and IBM XL C.
* Combine environment's CFLAGS with configure options when building.
Thanks to everyone who contributed to the development of this release.
* Hannes Magnusson
* A. Jesse Jiryu Davis
* Jeroen Ooms
* Petr PÃsaÅ™
* xpol
Peace,
A. Jesse Jiryu Davis
Libbson-1.2.1
=============
It is my pleasure to announce to you the release of Libbson-1.2.1.
Changes since the previous stable release, 1.2.0 are solely in the content
and format of documentation.
Peace,
A. Jesse Jiryu Davis
Libbson-1.2.0
=============
It is my pleasure to announce to you the release of Libbson-1.2.0.
Changes since the previous stable release, 1.1.11:
* Add bson_mem_restore_vtable(), the inverse of bson_mem_set_vtable().
* Enable runtime asserts in release build.
* Fixed compiler warnings and build failures on various platforms.
* Improvements to the formatting and contents of the documentation.
Thanks to everyone who contributed to the development of this release.
* A. Jesse Jiryu Davis
* Hannes Magnusson
* Jason Carey
* Kyle Suarez
* Derick Rethans
* David Hatch
Peace,
A. Jesse Jiryu Davis
Libbson 1.2.0-rc0
==================
It is my pleasure to announce to you the release candidate of Libbson-1.2.0.
Changes:
* Merge changes from 1.1.11.
* Enable runtime asserts in release build.
Thanks to everyone who contributed to the development of this release candidate.
* A. Jesse Jiryu Davis
* Hannes Magnusson
* Kyle Suarez
* Jason Carey
-- A. Jesse Jiryu Davis
Libbson 1.2.0-beta
==================
It is my pleasure to announce to you the beta of Libbson-1.2.0.
This release adds the bson_mem_restore_vtable() function to undo the effect
of bson_mem_set_vtable().
Thanks to everyone who contributed to the development of this beta.
* Jason Carey
* Hannes Magnusson
Libbson-1.1.11
==============
It is my pleasure to announce to you the release of Libbson-1.1.11.
This is a patch release with improvements to the documentation:
* Document bson streaming reads with an example,
bson-streaming-reader.c.
* Document callback function types bson_reader_destroy_func_t and
bson_reader_read_func_t.
Thanks to Kyle Suarez for his contributions to this version of Libbson.
-- A. Jesse Jiryu Davis
Libbson-1.1.10
==============
No change since 1.1.9; released to keep pace with libmongoc's version.
-- A. Jesse Jiryu Davis
Libbson-1.1.9
=============
This is a patch release with a fix for the build system:
* "./configure --enable-coverage" works now.
-- A. Jesse Jiryu Davis
Libbson-1.1.8
=============
No change since 1.1.7; released to keep pace with libmongoc's version.
-- A. Jesse Jiryu Davis
Libbson-1.1.7
=============
It is my pleasure to announce to you the release of Libbson-1.1.7.
This is a patch release with bug fixes:
* Unchecked error in bson_utf8_escape_for_json caused unbounded memory growth
and a crash.
* Nicer floating-point formatting in bson_as_json.
* Link error with CMake on Mac.
Thanks to everyone who contributed to this version of Libbson.
* A. Jesse Jiryu Davis
* Jason Carey
* Jeroen Ooms
* Hannes Magnusson
* Hendrik Dahlkamp
-- A. Jesse Jiryu Davis
Libbson-1.1.6
=============
No change since 1.1.5; released to keep pace with libmongoc's version.
-- A. Jesse Jiryu Davis
Libbson 1.1.5
=============
It is my pleasure to announce to you the release of Libbson-1.1.5.
This is a patch release with small bug fixes:
* Fix link error "missing __sync_add_and_fetch_4" in GCC on i386 -
the functions bson_atomic_int_add and bson_atomic_int64_add are now
compiled and exported if needed in i386 mode
* Fix version check for GCC 5 and future versions of Clang
* Fix warnings and errors building on various platforms
With this release, Libbson abandons the convention that odd-numbered patch
versions indicate unstable releases. We switch to simple semantic versioning:
1.1.5 is a stable release with bug fixes since 1.1.4. During subsequent
development the version will be "1.1.6-dev".
Thanks to everyone who contributed to this version of Libbson.
* A. Jesse Jiryu Davis
* Christian Hergert
* Jason Carey
* Hannes Magnusson
* Paul Melnikow
-- A. Jesse Jiryu Davis
Libbson 1.1.4
=============
It is my pleasure to announce to you the release of Libbson-1.1.4.
This release is a minor patch release with one bug fix for bson_iter_timeval
Thanks to everyone who contributed to the development of this release candidate for
Libbson.
* Jason Carey
* A. Jesse Jiryu Davis
* Vladimir Zidar
-- Jason Carey
Libbson 1.1.2
=============
It is my pleasure to announce to you the release of Libbson-1.1.2.
This release is a minor patch release with one bug fix for mingw.
* sscanf_s doesn't exist for mingw.
-- Jason Carey
Libbson 1.1.0
=============
It is my pleasure to announce to you the release of Libbson-1.1.0.
This release is a stable release with some ABI additions and bugfixes.
The below changes include the changes mentioned in the rc0.
ABI/API changes include:
* RC0
* Deprecation of bson_copy_to_excluding
* Addition of bson_copy_to_excluding_noinit
* Removal of MIN, MAX and ABS macros in favor of BSON_MIN, BSON_MAX and
BSON_ABS. Note this is a breaking source level change if you relied on
these from bson.h. Also note that this is not a breaking ABI change.
* Addition of BSON_ERROR_BUFFER_SIZE macro
Other changes include:
* RC0
* Addition of a versioned ABI for the libbson shared library
* fixed bson_get_monotonic_time fallback when a system monotonic clock can not
be found. Formerly failed to compile with an incorrect call to
bson_gettimeofday
* Allow the "dbref" convention in bson_validate when BSON_VALIDATE_DOLLAR_KEYS
is present
* Support for ISO-8601 or $numberLong dates in bson <-> json parsing
* Quiet various compiler warnings
Thanks to everyone who contributed to the development of this release candidate for
Libbson.
* Adam Midvidy
* Christian Hergert
* Daniel Colchete
* Ivan Suvorov
* Hannes Magnusson
* Jason Carey
* Jérôme Lebel
* Samantha Ritter
-- Jason Carey
Libbson 1.1.0-rc0
=================
It is my pleasure to announce to you the release of Libbson-1.1.0-rc0.
This release is a release candidate release with some ABI additions and bugfixes.
ABI changes include:
* Deprecation of bson_copy_to_excluding
* Addition of bson_copy_to_excluding_noinit
Other changes include:
* Addition of a versioned ABI for the libbson shared library
* fixed bson_get_monotonic_time fallback when a system monotonic clock can not
be found. Formerly failed to compile with an incorrect call to
bson_gettimeofday
* Allow the "dbref" convention in bson_validate when BSON_VALIDATE_DOLLAR_KEYS
is present
* Support for ISO-8601 or $numberLong dates in bson <-> json parsing
* Quiet various compiler warnings
Thanks to everyone who contributed to the development of this release candidate for
Libbson.
* Adam Midvidy
* Christian Hergert
* Daniel Colchete
* Ivan Suvorov
* Jason Carey
* Jérôme Lebel
-- Jason Carey
Libbson 1.0.2
=============
It is my pleasure to announce to you the release of Libbson-1.0.2.
This release is a minor point release with no ABI changes and mostly small
bugfixes.
Changes include:
* bson_init_from_json supports top level arrays
* fixes for bson_strerror_r
* fix for timeouts on OS X
* house cleaning for various integer types
Thanks to everyone who contributed to the development of this point release for
Libbson.
* Adam Midvidy
* Christian Hergert
* Jason Carey
* Jérôme Lebel
* Tyler Brock
-- Jason Carey
Libbson 1.0.0
=============
It is my very distinct pleasure to announce to you the release of
Libbson-1.0.0!
This is the culmination of just over a year of work and could not have been
done without the help of our wonderful community.
Thanks to everyone who contributed to the development of Libbson!
* Christian Hergert
* Jason Carey
* Jose Sebastian Battig
* Maxim Zakharov
* Jérôme Lebel
* Itay Neeman
* Mike Manilone
* Michael Kuhn
* Kyle Suarez
* Josh Blum
* Jason Choy
* mntmnt7@gmail.com
* Tyler Brock
* Stefan Kaes
* Paul Melnikow
* Matt Cotter
* Gary J. Murakami
* Toon Schoenmakers
* Máximo Cuadros
* Michael Whittaker
* Kota Yamaguchi
* Justin Case
* Jeff Yemin
* Ivan Suvorov
* Hannes Magnusson
* Eric Daniels
* Anil Kumar
* A. Jesse Jiryu Davis
Happy Hacking!
-- Christian Hergert
Libbson 0.98.0
==============
One more step closer to a 1.0!
This release has a few fixes as we near the finish line of a 1.0 release.
We have bumped the version to 0.98.0 to sync up with MongoDB C driver, which
is the primary consumer of this library.
This release includes a new memory callback vtable to help in embedding
situations that have their own custom allocator such as various language
runtimes.
A few compilation fixes for various C++ compilers have also been included.
A special thanks to:
* Itay Neeman
* Michael Whittaker
Happy Hacking!
-- Christian
Libbson 0.8.4
=============
Another incremental release with a couple of new functions and bugfixes.
In this release you will find the following changes:
* Alignment fixes for Solaris Studio C compiler.
* RPM and Debian packaging helpers.
* bson_gettimeofday() has dropped the deprecated timezone field used
when calling posix gettimeofday(). This eases portability concerns.
It is technically an ABI break, but since the field was never set,
in reality it shouldn't be an issue.
* Multi-byte optimizations for bson_oid_to_string() have been disabled
on non-x86 based platforms. This should aid in architecture portability.
* The JSON parser can now support $numberLong.
* bson_ascii_strtoll() has been added, which is a portable strtoll()
implementation. This is primarily useful for Windows users and is
used by the JSON parser.
* A bug was fixed in bson_iter_find_descendent() where the wrong field
could be matched if it's prefix matched the query.
* bson_array_as_json() has been added to convert a bson_t as a top-level
array.
Thanks to:
* Kyle Suarez
* Itay Neeman
Happy Hacking!
Libbson 0.8.2
=============
A bugfix release is here as a follow up to 0.8.0.
In this release you will find the following changes:
* A fix for BCON when used from C++.
* Change bson_next_power_of_two() to accept size_t. This should not be
an ABI break since it is static inline.
Happy Hacking!
Libbson 0.8.0
=============
It's that time again, time for another Libbson release!
This cycle includes much, much more documentation for your perusing. There is
much more cross-referencing and structure for your navigation pleasure.
We've improved support for Libbson on a few more exotic platforms. SPARC
support is looking pretty good these days.
You'll also find some new examples in this release to help you get started a
bit faster. If there is something you'd like to see, just ask!
There are a few ABI breaks this cycle, as we are well on the road to a 1.0 and
would like things as clean as possible. I anticipate a few more during the next
couple of cycles, but we will try to keep them to a minimum. With that said,
you *WILL* need to recompile your application against 0.8.0.
Happy Hacking!
Libbson 0.6.8
=============
Quickly following up on the 0.6.6 release is 0.6.8. This release contains
a couple of bugfixes and more support for older architectures.
On big-endian systems, bson_append_date_time() was not properly converting
to little-endian. This is now fixed.
We've added support for Sun Pro C Compiler on Solaris 10 and 11. This includes
support for SPARC systems as well as x86_64. In particular, intrinsics were
added for the Solaris/SPARC/SunProC combination. If you are running SunProC
on a non-Solaris platform, a fallback path will be used which is slower than
native support for atomics. Additionally, bson_gettimeofday() does not fully
support timezones under SunProC as struct timezone is not defined.
Libbson will now check for GLibc 2.19 to remove various warnings with both
_GNU_SOURCE and _BSD_SOURCE defined.
Happy Hacking!
Libbson 0.6.6
=============
Another release for your hacking pleasure!
First off, note that there are two ABI breaks as part of this release. We
felt they were important as they will help us stablize towards a 1.0 release.
It is recommended that you recompile against this version of libbson.
Lots of small fixes went into this release to help get things building better
on various platforms. Windows support should be improved and many warnings have
been cleaned up.
The signature of bson_realloc_func has changed to allow for context to be
provided. This should help in situations where a pointer to the memory pool is
required.
bson_destroy_with_steal() has been added so that you can steal a buffer instead
of freeing it when bson_destroy() is called.
bson_new_from_buffer() has been added so that you can provide your own realloc
function to manage the underlying buffer. This will be useful for bindings that
want to integrate their memory manager for bson documents.
bson_value_t is a new container type that can hold any bson type.
I'd like to thank everyone who contributed to this release.
Gary Murakami
Jason Carey
Jose Sebastian Battig
Máximo Cuadros
Paul Melnikow
Stefan Kaes
Happy hacking!
Libbson 0.6.4
=============
This is just a followup release of libbson as we work towards stablizing for
the new mongo-c-driver release. In fact, it only includes build work and a
new macro, bson_clear().
Happy hacking!
Libbson 0.6.2
=============
A new Libbson release is already here as a follow up to the 0.6.0 release.
This release includes a few build and installation fixes. In particular,
* Windows build fixes
* CMake build fixes
* C++ build fixes.
The monotonic clock is now more accurately calculated on Windows as well.
If you'd like to build on Windows, check out the section in README.md for
information on how to do so.
Happy hacking!
Libbson 0.6.0
=============
Many changes have gone into this release!
TL;DR
* C99 types (from C89).
* JSON parsing.
* Lots of Operating System support, including Windows.
* Parallel Test Suite.
* Revamped build system.
* A couple ABI breaks.
First off, 0.6.0 has gone through a significant amount of build system cleanup.
This should simplify using libbson as a submodule for those that wish to do so.
For example, the mongo-c-driver now does this using autotools.
Windows Vista and higher is now supported as a build target through the use of
cmake. See README.md for the instructions. Other platforms should continue to
use autotools.
The test suite has been improved and more tests added. We now generate random
seeds on every run to help catch more errors with additional fuzzing passes.
By default, the test suite will run all tests in parallel with subprocesses.
This should speed up execution of `make test' for contributors.
bson_string_t went through an ABI break to support power-of-two growth.
JSON parsing has been added through the bson_json_reader_t type. You can also
now use bson_init_from_json() for a simplified interface.
Types were revamped to appear to be using C99 types. If C99 types are
available, they will be used. If not, they will be emulated. This means you
can just go on using uint64_t and similar. We even use bool now.
Many functions have been made portable to deal with inconsistencies with Win32.
This release has been tested on the following operating systems:
* RedHat Enterprise 5, 6, and 7 beta.
* CentOS 6.5
* Ubuntu 12.04 LTS
* Fedora 20
* Windows 7
* FreeBSD 10
* DragonFly BSD
* Solaris 11
* SmartOS
* mingw64
Thanks again and enjoy using libbson!
Libbson 0.4.0
=============
This release includes a few bug fixes and copious documentation. Additionally,
we improved our fuzz testing and found a couple issues in the process. It is
suggested that everyone upgrade their installations to 0.4.0.
We have been busy adding a lot of documentation that we hope you will like.
Many `man' pages have been added for various API endpoints and structures. If
you use vim, remember that you can jump to the documentation with k
while on a symbol.
Thanks and enjoy using libbson!
Libbson 0.2.4
=============
This release includes some more performance improvements and bug fixes.
It contains an important fix for dealing with invalid string lengths that could
cause an integer overflow when checking to see if the string length fits within
the end of the buffer.
There is preliminary support for Solaris on x86_64 and SPARC.
Generating OIDs is now simpler with the use of bson_context_get_default(). This
function will return a thread-safe generic bson_context_t implementation.
Alternatively, you may pass NULL to bson_oid_init() for the context and the
default context is automatically used.
The fuzz tests now use srand() with a 32-bit integer derived from /dev/urandom.
Endianess conversions are now performed by __builtin_bswap*() functions when
available with the GCC compiler.
Endianness conversions for the double type are now properly handled on
big-endian systems.
bson_reinit() has been added to cleanup code that needs to destroy and then
initialize a bson_t.
Validation of Code with Scope fields was absent from bson_validate(). This is
now supported.
Libbson 0.2.2
=============
This release includes a few performance improvements and bug fixes.
The bson_t structure is more efficient when growing allocated buffers.
The use of memalign() was unnecessary for allocated bson_t structures
and has therefore been removed. Performance sensitive allocations now
use bson_malloc() instead of calloc() and initialize fields directly.
Stack alignment of bson_t is now enforced through compiler intrinsics.
The unit tests can now support running inside of valgrind to check for
various memory leaks. Simply defing VALGRIND=valgrind when running
`make test`.
Enjoy libbson-0.2.2!
Libbson 0.2.0
=============
This is the initial release of Libbson. It has not yet reached API and ABI
maturity and is therefore subject to change without notice. Developers are
encouraged to start using Libbson as we journey on the road to 1.0, where ABI
stability will be guaranteed.
Libbson is Apache 2.0 licensed so that it can be embedded in a multitude of
scenarios. This means that we try hard to not rely on external libraries.
Therefore, Libbson contains useful routines to help in portability as well
as BSON support.
Libbson is the basis of a new MongoDB C driver that will follow shortly.
Please see the doc/ directory for documentation on how to use Libbson. We
would love for you to contribute to Libbson, whether that is code,
documentation or packaging.
libbson-1.9.2/README 0000777 0000000 0000000 00000000000 13225757660 0015532 2README.rst ustar 00root root 0000000 0000000 libbson-1.9.2/README.rst 0000664 0000000 0000000 00000005040 13225757660 0014656 0 ustar 00root root 0000000 0000000 =======
libbson
=======
libbson is a library providing useful routines related to building, parsing,
and iterating BSON documents.
Documentation / Support / Feedback
==================================
The documentation is available at http://mongoc.org/.
For issues with, questions about, or feedback for libbson, please look into
our `support channels `_. Please
do not email any of the libbson developers directly with issues or
questions - you're more likely to get an answer on the `mongodb-user list`_
on Google Groups.
Bugs / Feature Requests
=======================
Think you’ve found a bug? Want to see a new feature in libbson? Please open a
case in our issue management tool, JIRA:
- `Create an account and login `_.
- Navigate to `the CDRIVER project `_.
- Click **Create Issue** - Please provide as much information as possible about the issue type and how to reproduce it.
Bug reports in JIRA for all driver projects (i.e. CDRIVER, CSHARP, JAVA) and the
Core Server (i.e. SERVER) project are **public**.
How To Ask For Help
-------------------
If you are having difficulty building libbson after reading the below instructions, please email
the `mongodb-user list`_ to ask for help. Please include in your email all of the following
information:
- The version of libbson you are trying to build (branch or tag).
- Examples: master branch, 1.2.1 tag
- Host OS, version, and architecture.
- Examples: Windows 8 64-bit x86, Ubuntu 12.04 32-bit x86, OS X Mavericks
- C Compiler and version.
- Examples: GCC 4.8.2, MSVC 2013 Express, clang 3.4, XCode 5
- The output of ``./autogen.sh`` or ``./configure`` (depending on whether you are building from a
repository checkout or from a tarball). The output starting from "libbson was configured with
the following options" is sufficient.
- The text of the error you encountered.
Failure to include the relevant information will result in additional round-trip
communications to ascertain the necessary details, delaying a useful response.
.. _mongodb-user list: http://groups.google.com/group/mongodb-user
Security Vulnerabilities
------------------------
If you’ve identified a security vulnerability libbson or any other
MongoDB project, please report it according to the `instructions here
`_.
Installation
============
Detailed installation instructions are in the manual:
http://mongoc.org/libbson/current/installing.html
libbson-1.9.2/THIRD_PARTY_NOTICES 0000664 0000000 0000000 00000020747 13225757660 0016142 0 ustar 00root root 0000000 0000000 Libbson uses third-party libraries distributed under different licenses.
License notice for jsonsl
-------------------------------------------------------------------------------
MIT License
Copyright (c) 2012-2015 M. Nunberg, mnunberg@haskalah.org
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
License notice for bson-stdint-win32.h
-------------------------------------------------------------------------------
BSD 3-Clause License
ISO C9x compliant stdint.h for Microsoft Visual Studio
Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
Copyright (c) 2006-2013 Alexander Chemeris
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the product nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License notice for b64_pton.h and b64_ntop.h
-------------------------------------------------------------------------------
ISC License and IBM License
Copyright (c) 1996, 1998 by Internet Software Consortium.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
Portions Copyright (c) 1995 by International Business Machines, Inc.
International Business Machines, Inc. (hereinafter called IBM) grants
permission under its copyrights to use, copy, modify, and distribute this
Software with or without fee, provided that the above copyright notice and
all paragraphs of this notice appear in all copies, and that the name of IBM
not be used in connection with the marketing of any product incorporating
the Software or modifications thereof, without specific, written prior
permission.
To the extent it has a right to do so, IBM grants an immunity from suit
under its patents, if any, for the use, sale or manufacture of products to
the extent that such products are used for performing Domain Name System
dynamic updates in TCP/IP networks by means of the Software. No immunity is
granted for any product per se or for any other function of any product.
THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
License notice for bson-md5.h
-------------------------------------------------------------------------------
ZLib License
Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved.
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
L. Peter Deutsch
ghost@aladdin.com
License notice for taglist.py
-------------------------------------------------------------------------------
MIT License
Portions Copyright 2007-2009 by the Sphinx team.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
License notice for mongoc.css_t
-------------------------------------------------------------------------------
MIT License
Portions Copyright 2013 by Ignacy Sokolowski.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
libbson-1.9.2/VERSION_CURRENT 0000664 0000000 0000000 00000000006 13225757660 0015436 0 ustar 00root root 0000000 0000000 1.9.2
libbson-1.9.2/VERSION_RELEASED 0000664 0000000 0000000 00000000006 13225757660 0015500 0 ustar 00root root 0000000 0000000 1.9.2
libbson-1.9.2/autogen.sh 0000775 0000000 0000000 00000001657 13225757660 0015202 0 ustar 00root root 0000000 0000000 #! /bin/sh
# Allow invocation from a separate build directory; in that case, we change
# to the source directory to run the auto*, then change back before running configure
srcdir=`dirname "$0"`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd "$srcdir" || exit 1
if [ ! -f README ]; then
ln -s README.md README
fi
touch ChangeLog
touch AUTHORS
if test -z "$(which libtoolize)" && test -z "$(which glibtoolize)"; then
echo "Error: libtoolize was not found on your system. Cannot continue."
if test "$(uname)" = "Darwin"; then
echo "On Darwin, this is named glibtoolize"
fi
fi
if test -z `which autoreconf`; then
echo "Error: autoreconf not found, please install it."
exit 1
fi
autoreconf --force --verbose --install -I build/autotools $ACLOCAL_FLAGS|| exit $?
rm -rf autom4te.cache
cd "$ORIGDIR" || exit 1
if test -z "$NOCONFIGURE"; then
"$srcdir"/configure $AUTOGEN_CONFIGURE_ARGS "$@" || exit $?
fi
libbson-1.9.2/build/ 0000775 0000000 0000000 00000000000 13225757660 0014267 5 ustar 00root root 0000000 0000000 libbson-1.9.2/build/Makefile.am 0000664 0000000 0000000 00000000112 13225757660 0016315 0 ustar 00root root 0000000 0000000 EXTRA_DIST += build/maintainer-flags.txt
include build/cmake/Makefile.am
libbson-1.9.2/build/autotools/ 0000775 0000000 0000000 00000000000 13225757660 0016320 5 ustar 00root root 0000000 0000000 libbson-1.9.2/build/autotools/CheckAtomics.m4 0000664 0000000 0000000 00000002112 13225757660 0021113 0 ustar 00root root 0000000 0000000 AC_LANG_PUSH([C])
AC_MSG_CHECKING([for __sync_add_and_fetch_4])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]],
[[int32_t v = 1; return __sync_add_and_fetch_4 (&v, (int32_t)10);]])],
[AC_MSG_RESULT(yes)
have_sync_add_and_fetch_4=yes],
[AC_MSG_RESULT(no)
have_sync_add_and_fetch_4=no])
AS_IF([test "$have_sync_add_and_fetch_4" = "yes"],
[AC_SUBST(BSON_HAVE_ATOMIC_32_ADD_AND_FETCH, 1)],
[AC_SUBST(BSON_HAVE_ATOMIC_32_ADD_AND_FETCH, 0)])
AC_MSG_CHECKING([for __sync_add_and_fetch_8])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]],
[[int64_t v; return __sync_add_and_fetch_8 (&v, (int64_t)10);]])],
[AC_MSG_RESULT(yes)
have_sync_add_and_fetch_8=yes],
[AC_MSG_RESULT(no)
have_sync_add_and_fetch_8=no])
AS_IF([test "$have_sync_add_and_fetch_8" = "yes"],
[AC_SUBST(BSON_HAVE_ATOMIC_64_ADD_AND_FETCH, 1)],
[AC_SUBST(BSON_HAVE_ATOMIC_64_ADD_AND_FETCH, 0)])
AC_LANG_POP([C])
libbson-1.9.2/build/autotools/CheckCompiler.m4 0000664 0000000 0000000 00000004321 13225757660 0021272 0 ustar 00root root 0000000 0000000 # If CFLAGS and CXXFLAGS are unset, default to empty.
# This is to tell automake not to include '-g' if C{XX,}FLAGS is not set.
# For more info - http://www.gnu.org/software/automake/manual/autoconf.html#C_002b_002b-Compiler
if test -z "$CXXFLAGS"; then
CXXFLAGS=""
fi
if test -z "$CFLAGS"; then
CFLAGS=""
fi
AC_PROG_CC
AC_PROG_CXX
# Check that an appropriate C compiler is available.
c_compiler="unknown"
AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#if !(defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER))
#error Not a supported GCC compiler
#endif
#if defined(__GNUC__)
#define GCC_VERSION (__GNUC__ * 10000 \
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
#if GCC_VERSION < 40100
#error Not a supported GCC compiler
#endif
#endif
])], [c_compiler="gcc"], [])
# If our BEGIN_IGNORE_DEPRECATIONS macro won't work, pass
# -Wno-deprecated-declarations
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#if !defined(__clang__) && defined(__GNUC__)
#define GCC_VERSION (__GNUC__ * 10000 \
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
#if GCC_VERSION < 40600
#error Does not support deprecation warning pragmas
#endif
#endif
])], [], [CFLAGS="$CFLAGS -Wno-deprecated-declarations"])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#if defined(__clang__)
#define CLANG_VERSION (__clang_major__ * 10000 \
+ __clang_minor__ * 100 \
+ __clang_patchlevel__)
#if CLANG_VERSION < 30300
#error Not a supported Clang compiler
#endif
#endif
])], [c_compiler="clang"], [])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#if !(defined(__SUNPRO_C))
#error Not a supported Sun compiler
#endif
])], [c_compiler="sun"], [])
AC_LANG_POP([C])
if test "$c_compiler" = "unknown"; then
AC_MSG_ERROR([Compiler GCC >= 4.1 or Clang >= 3.3 is required for C compilation])
fi
# GLibc 2.19 complains about both _BSD_SOURCE and _GNU_SOURCE. The _GNU_SOURCE
# contains everything anyway. So just use that.
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include
#ifndef __GLIBC__
#error not glibc
#endif
]], [])],
LIBC_FEATURES="-D_GNU_SOURCE",
LIBC_FEATURES="-D_BSD_SOURCE")
AC_SUBST(LIBC_FEATURES)
AC_C_CONST
AC_C_INLINE
AC_C_TYPEOF
libbson-1.9.2/build/autotools/CheckHeaders.m4 0000664 0000000 0000000 00000000332 13225757660 0021071 0 ustar 00root root 0000000 0000000 AC_HEADER_STDBOOL
AC_SUBST(BSON_HAVE_STDBOOL_H, 0)
if test "$ac_cv_header_stdbool_h" = "yes"; then
AC_SUBST(BSON_HAVE_STDBOOL_H, 1)
fi
AC_CREATE_STDINT_H([src/bson/bson-stdint.h])
AC_CHECK_HEADERS_ONCE([strings.h])
libbson-1.9.2/build/autotools/CheckHost.m4 0000664 0000000 0000000 00000001355 13225757660 0020441 0 ustar 00root root 0000000 0000000 AC_CANONICAL_HOST
os_win32=no
os_linux=no
os_freebsd=no
os_gnu=no
case "$host" in
*-mingw*|*-*-cygwin*)
os_win32=yes
TARGET_OS=windows
;;
*-*-*netbsd*)
os_netbsd=yes
TARGET_OS=unix
;;
*-*-*freebsd*)
os_freebsd=yes
TARGET_OS=unix
;;
*-*-*openbsd*)
os_openbsd=yes
TARGET_OS=unix
;;
*-*-linux*)
os_linux=yes
os_gnu=yes
TARGET_OS=unix
;;
*-*-solaris*)
os_solaris=yes
TARGET_OS=unix
;;
*-*-darwin*)
os_darwin=yes
TARGET_OS=unix
;;
gnu*|k*bsd*-gnu*)
os_gnu=yes
TARGET_OS=unix
;;
*)
AC_MSG_WARN([*** Please add $host to configure.ac checks!])
;;
esac
libbson-1.9.2/build/autotools/CheckProgs.m4 0000664 0000000 0000000 00000000626 13225757660 0020616 0 ustar 00root root 0000000 0000000 AC_PATH_PROG(PERL, perl)
if test -z "$PERL"; then
AC_MSG_ERROR([You need 'perl' to compile libbson])
fi
AC_PATH_PROG(MV, mv)
if test -z "$MV"; then
AC_MSG_ERROR([You need 'mv' to compile libbson])
fi
AC_PATH_PROG(GREP, grep)
if test -z "$GREP"; then
AC_MSG_ERROR([You need 'grep' to compile libbson])
fi
# Optional for documentation
AC_PATH_PROG(SPHINX_BUILD, sphinx-build)
AC_PROG_INSTALL
libbson-1.9.2/build/autotools/CheckTarget.m4 0000664 0000000 0000000 00000001147 13225757660 0020751 0 ustar 00root root 0000000 0000000 AC_CANONICAL_SYSTEM
enable_crosscompile=no
if test "x$host" != "x$target"; then
enable_crosscompile=yes
case "$target" in
*-mingw*|*-*-cygwin*)
TARGET_OS=windows
;;
arm*-darwin*)
TARGET_OS=unix
;;
powerpc64-*-linux-gnu)
TARGET_OS=unix
;;
arm*-linux-*)
TARGET_OS=unix
;;
*)
AC_MSG_ERROR([Cross compiling is not supported for target $target])
;;
esac
fi
AC_SUBST(BSON_OS, 1)
if test "$TARGET_OS" = "windows"; then
AC_SUBST(BSON_OS, 2)
fi
libbson-1.9.2/build/autotools/Coverage.m4 0000664 0000000 0000000 00000000320 13225757660 0020310 0 ustar 00root root 0000000 0000000 COVERAGE_CFLAGS=""
COVERAGE_LDFLAGS=""
if test "$enable_coverage" = "yes"; then
COVERAGE_CFLAGS="--coverage -g"
COVERAGE_LDFLAGS="--coverage"
fi
AC_SUBST(COVERAGE_CFLAGS)
AC_SUBST(COVERAGE_LDFLAGS)
libbson-1.9.2/build/autotools/Endian.m4 0000664 0000000 0000000 00000000260 13225757660 0017756 0 ustar 00root root 0000000 0000000 enable_bigendian=no
AC_C_BIGENDIAN
AC_SUBST(BSON_BYTE_ORDER, 1234)
if test "x$ac_cv_c_bigendian" = "xyes"; then
AC_SUBST(BSON_BYTE_ORDER, 4321)
enable_bigendian=yes
fi
libbson-1.9.2/build/autotools/FindDependencies.m4 0000664 0000000 0000000 00000007524 13225757660 0021761 0 ustar 00root root 0000000 0000000 # Check for strnlen()
dnl AC_CHECK_FUNC isn't properly respecting _XOPEN_SOURCE for strnlen for unknown reason
AC_SUBST(BSON_HAVE_STRNLEN, 0)
AC_CACHE_CHECK([for strnlen],
bson_cv_have_strnlen,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include
int strnlen () { return 0; }
]])],
[bson_cv_have_strnlen=no],
[bson_cv_have_strnlen=yes])])
if test "$bson_cv_have_strnlen" = yes; then
AC_SUBST(BSON_HAVE_STRNLEN, 1)
fi
# Check for reallocf() (BSD/Darwin)
AC_SUBST(BSON_HAVE_REALLOCF, 0)
AC_CACHE_CHECK([for reallocf],
bson_cv_have_reallocf,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include
int reallocf () { return 0; }
]])],
[bson_cv_have_reallocf=no],
[bson_cv_have_reallocf=yes])])
if test "$bson_cv_have_reallocf" = yes; then
AC_SUBST(BSON_HAVE_REALLOCF, 1)
fi
# Check for syscall()
AC_SUBST(BSON_HAVE_SYSCALL_TID, 0)
AC_CACHE_CHECK([for syscall],
bson_cv_have_syscall_tid,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include
#include
int syscall () { return 0; }
]])],
[bson_cv_have_syscall_tid=no],
[bson_cv_have_syscall_tid=yes])])
if test "$bson_cv_have_syscall_tid" = yes -a "$os_darwin" != "yes"; then
AC_CACHE_CHECK([for SYS_gettid],
bson_cv_have_sys_gettid_tid,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include
#include
int gettid () { return SYS_gettid; }
]])],
[bson_cv_have_sys_gettid_tid=yes],
[bson_cv_have_sys_gettid_tid=no])])
if test "$bson_cv_have_sys_gettid_tid" = yes; then
AC_SUBST(BSON_HAVE_SYSCALL_TID, 1)
fi
fi
# Check for snprintf()
AC_SUBST(BSON_HAVE_SNPRINTF, 0)
AC_CHECK_FUNC(snprintf, [AC_SUBST(BSON_HAVE_SNPRINTF, 1)])
# Check for struct timespec
AC_SUBST(BSON_HAVE_TIMESPEC, 0)
AC_CHECK_TYPE([struct timespec], [AC_SUBST(BSON_HAVE_TIMESPEC, 1)], [], [#include ])
# Check for clock_gettime and if it needs -lrt
AC_SUBST(BSON_HAVE_CLOCK_GETTIME, 0)
AC_SEARCH_LIBS([clock_gettime], [rt], [AC_SUBST(BSON_HAVE_CLOCK_GETTIME, 1)])
# Check if math functions need -lm
AC_SEARCH_LIBS([floor], [m])
# Check for gmtime_r()
AC_SUBST(BSON_HAVE_GMTIME_R, 0)
AC_CHECK_FUNC(gmtime_r, [AC_SUBST(BSON_HAVE_GMTIME_R, 1)])
# Check for rand_r()
AC_SUBST(BSON_HAVE_RAND_R, 0)
AC_CHECK_FUNC(rand_r, [AC_SUBST(BSON_HAVE_RAND_R, 1)], [], [#include ])
# Check for pthreads. We might need to make this better to handle mingw,
# but I actually think it is okay to just check for it even though we will
# use win32 primatives.
AX_PTHREAD([],
[AC_MSG_ERROR([libbson requires pthreads on non-Windows platforms.])])
# The following is borrowed from the guile configure script.
#
# On past versions of Solaris, believe 8 through 10 at least, you
# had to write "pthread_once_t foo = { PTHREAD_ONCE_INIT };".
# This is contrary to POSIX:
# http://www.opengroup.org/onlinepubs/000095399/functions/pthread_once.html
# Check here if this style is required.
#
# glibc (2.3.6 at least) works both with or without braces, so the
# test checks whether it works without.
#
AC_SUBST(BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES, 0)
AC_CACHE_CHECK([whether PTHREAD_ONCE_INIT needs braces],
bson_cv_need_braces_on_pthread_once_init,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include
pthread_once_t foo = PTHREAD_ONCE_INIT;]])],
[bson_cv_need_braces_on_pthread_once_init=no],
[bson_cv_need_braces_on_pthread_once_init=yes])])
if test "$bson_cv_need_braces_on_pthread_once_init" = yes; then
AC_SUBST(BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES, 1)
fi
# Solaris needs to link against socket libs.
# This is only used in our streaming bson examples
if test "$os_solaris" = "yes"; then
SOCKET_CFLAGS="$CFLAGS -D__EXTENSIONS__"
SOCKET_CFLAGS="$CFLAGS -D_XOPEN_SOURCE=1"
SOCKET_CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
SOCKET_LDFLAGS="$LDFLAGS -lsocket -lnsl"
AC_SUBST(SOCKET_CFLAGS)
AC_SUBST(SOCKET_LDFLAGS)
fi
libbson-1.9.2/build/autotools/MaintainerFlags.m4 0000664 0000000 0000000 00000001440 13225757660 0021625 0 ustar 00root root 0000000 0000000 AS_IF(
[test "x$enable_maintainer_flags" = "xyes" && test "x$GCC" = "xyes"],
[
# clang only warns if it doesn't support a warning option, turn it into an
# error so we really know if whether it supports it.
AX_CHECK_COMPILE_FLAG(
"-Werror=unknown-warning-option",
[WERROR_UNKNOWN_OPTION="-Werror=unknown-warning-option"],
[WERROR_UNKNOWN_OPTION=""])
# Read maintainer-flags.txt and apply each flag that the compiler supports.
m4_foreach([MAINTAINER_FLAG], m4_split(m4_normalize(m4_esyscmd(cat build/maintainer-flags.txt))), [
AX_CHECK_COMPILE_FLAG(
MAINTAINER_FLAG,
[MAINTAINER_CFLAGS="$MAINTAINER_CFLAGS MAINTAINER_FLAG"],
[],
[$WERROR_UNKNOWN_OPTION])
])
]
AC_SUBST(MAINTAINER_CFLAGS)
)
libbson-1.9.2/build/autotools/Optimizations.m4 0000664 0000000 0000000 00000001632 13225757660 0021435 0 ustar 00root root 0000000 0000000 OPTIMIZE_CFLAGS=""
OPTIMIZE_LDFLAGS=""
AC_DEFUN([check_link_flag],
[AX_CHECK_LINK_FLAG([$1], [$2], [$3], [-Werror $4])])
# Enable -Bsymbolic
AS_IF([test "$enable_optimizations" != "no"], [
check_link_flag([-Wl,-Bsymbolic], [OPTIMIZE_LDFLAGS="$OPTIMIZE_LDFLAGS -Wl,-Bsymbolic"])
CFLAGS="$CFLAGS -O2"
])
# Enable Link-Time-Optimization
AS_IF([test "$enable_lto" = "yes"],
[AS_IF([test "$c_compiler" = "gcc"],
[AX_CHECK_COMPILE_FLAG([-flto], [OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS -flto"])
check_link_flag([-flto], [OPTIMIZE_LDFLAGS="$OPTIMIZE_LDFLAGS -flto"])],
[AC_MSG_WARN([LTO is not yet available on your compiler.])])])
AC_SUBST(OPTIMIZE_CFLAGS)
AC_SUBST(OPTIMIZE_LDFLAGS)
# Add '-g' flag to gcc to build with debug symbols.
if test "$enable_debug_symbols" = "min"; then
CFLAGS="$CFLAGS -g1"
elif test "$enable_debug_symbols" != "no"; then
CFLAGS="$CFLAGS -g"
fi
libbson-1.9.2/build/autotools/PrintBuildConfiguration.m4 0000664 0000000 0000000 00000002341 13225757660 0023366 0 ustar 00root root 0000000 0000000 AC_OUTPUT
if test -n "$BSON_PRERELEASE_VERSION"; then
cat << EOF
*** IMPORTANT ***
This is an unstable version of libbson.
It is for test purposes only.
Please, DO NOT use it in a production environment.
It will probably crash and you will lose your data.
Additionally, the API/ABI may change during the course
of development.
Thanks,
The libbson team.
*** END OF WARNING ***
EOF
fi
echo "
libbson $BSON_VERSION was configured with the following options:
Build configuration:
Enable debugging (slow) : ${enable_debug}
Enable extra alignment (required for 1.0 ABI) : ${enable_extra_align}
Compile with debug symbols (slow) : ${enable_debug_symbols}
Enable GCC build optimization : ${enable_optimizations}
Code coverage support : ${enable_coverage}
Cross Compiling : ${enable_crosscompile}
Big endian : ${enable_bigendian}
Link Time Optimization (experimental) : ${enable_lto}
Documentation:
man : ${enable_man_pages}
HTML : ${enable_html_docs}
"
libbson-1.9.2/build/autotools/ReadCommandLineArguments.m4 0000664 0000000 0000000 00000006526 13225757660 0023443 0 ustar 00root root 0000000 0000000 AC_MSG_CHECKING([whether to do a debug build])
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug], [turn on debugging [default=no]]),
[],[enable_debug="no"])
AC_MSG_RESULT([$enable_debug])
AC_MSG_CHECKING([whether to enable optimized builds])
AC_ARG_ENABLE(optimizations,
AC_HELP_STRING([--enable-optimizations], [turn on build-time optimizations [default=yes]]),
[enable_optimizations=$enableval],
[
if test "$enable_debug" = "yes"; then
enable_optimizations="no";
else
enable_optimizations="yes";
fi
])
AC_MSG_RESULT([$enable_optimizations])
AC_MSG_CHECKING([whether to enable extra alignment of types])
AC_ARG_ENABLE(extra_align,
AC_HELP_STRING([--enable-extra-align], [turn on extra alignment of types. This is required for the 1.0 ABI [default=yes]]),
[enable_extra_align=$enableval],
[enable_extra_align="yes"])
AC_MSG_RESULT([$enable_extra_align])
AS_IF([test "$enable_extra_align" = "yes"],
[AC_SUBST(BSON_EXTRA_ALIGN, 1)],
[AC_SUBST(BSON_EXTRA_ALIGN, 0)])
AC_ARG_ENABLE(lto,
AC_HELP_STRING([--enable-lto], [turn on link time optimizations [default=no]]),
[enable_lto=$enableval],
[enable_lto=no])
AC_MSG_CHECKING([whether to enable code coverage support])
AC_ARG_ENABLE(coverage,
AC_HELP_STRING([--enable-coverage], [enable code coverage support [default=no]]),
[],
[enable_coverage="no"])
AC_MSG_RESULT([$enable_coverage])
AC_MSG_CHECKING([whether to enable debug symbols])
AC_ARG_ENABLE(debug_symbols,
AC_HELP_STRING([--enable-debug-symbols=yes|no|min|full], [enable debug symbols default=no, default=yes for debug builds]),
[
case "$enable_debug_symbols" in
yes) enable_debug_symbols="full" ;;
no|min|full) ;;
*) AC_MSG_ERROR([Invalid debug symbols option: must be yes, no, min or full.]) ;;
esac
],
[
if test "$enable_debug" = "yes"; then
enable_debug_symbols="yes";
else
enable_debug_symbols="no";
fi
])
AC_MSG_RESULT([$enable_debug_symbols])
# use strict compiler flags only on development releases
m4_define([maintainer_flags_default], [m4_ifset([BSON_PRERELEASE_VERSION], [yes], [no])])
AC_ARG_ENABLE([maintainer-flags],
[AS_HELP_STRING([--enable-maintainer-flags=@<:@no/yes@:>@],
[Use strict compiler flags @<:@default=]maintainer_flags_default[@:>@])],
[],
[enable_maintainer_flags=maintainer_flags_default])
AC_ARG_ENABLE([html-docs],
[AS_HELP_STRING([--enable-html-docs=@<:@yes/no@:>@],
[Build HTML documentation.])],
[],
[enable_html_docs=no])
AC_ARG_ENABLE([man-pages],
[AS_HELP_STRING([--enable-man-pages=@<:@yes/no@:>@],
[Build and install man-pages.])],
[],
[enable_man_pages=no])
AC_ARG_ENABLE([examples],
[AS_HELP_STRING([--enable-examples=@<:@yes/no@:>@],
[Build libbson examples.])],
[],
[enable_examples=yes])
AC_ARG_ENABLE([tests],
[AS_HELP_STRING([--enable-tests=@<:@yes/no@:>@],
[Build libbson tests.])],
[],
[enable_tests=yes])
libbson-1.9.2/build/autotools/SetupAutomake.m4 0000664 0000000 0000000 00000003227 13225757660 0021355 0 ustar 00root root 0000000 0000000 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_PROG_CC_C_O
# OS Conditionals.
AM_CONDITIONAL([OS_WIN32],[test "$os_win32" = "yes"])
AM_CONDITIONAL([OS_UNIX],[test "$os_win32" = "no"])
AM_CONDITIONAL([OS_LINUX],[test "$os_linux" = "yes"])
AM_CONDITIONAL([OS_GNU],[test "$os_gnu" = "yes"])
AM_CONDITIONAL([OS_DARWIN],[test "$os_darwin" = "yes"])
AM_CONDITIONAL([OS_FREEBSD],[test "$os_freebsd" = "yes"])
# Compiler Conditionals.
AM_CONDITIONAL([COMPILER_GCC],[test "$c_compiler" = "gcc" && test "$cxx_compiler" = "g++"])
AM_CONDITIONAL([COMPILER_CLANG],[test "$c_compiler" = "clang" && test "$cxx_compiler" = "clang++"])
# Feature Conditionals
AM_CONDITIONAL([ENABLE_DEBUG],[test "$enable_debug" = "yes"])
AM_CONDITIONAL([ENABLE_STATIC],[test "$enable_static" = "yes"])
# C99 Features
AM_CONDITIONAL([ENABLE_STDBOOL],[test "$enable_stdbool" = "yes"])
# Should we use pthreads
AM_CONDITIONAL([ENABLE_PTHREADS], test "$enable_pthreads" = "yes")
# Should we build the examples.
AM_CONDITIONAL([ENABLE_EXAMPLES],[test "$enable_examples" = "yes"])
# Should we build the tests.
AM_CONDITIONAL([ENABLE_TESTS],[test "$enable_tests" = "yes"])
# Should we build man pages
AM_CONDITIONAL([ENABLE_MAN_PAGES],[test "$enable_man_pages" = "yes"])
AS_IF([test "$enable_man_pages" = "yes" && test -z "$SPHINX_BUILD"],
[AC_MSG_ERROR([The Sphinx Python package must be installed to generate man pages.])])
# Should we build HTML documentation
AM_CONDITIONAL([ENABLE_HTML_DOCS],[test "$enable_html_docs" = "yes"])
AS_IF([test "$enable_html_docs" = "yes" && test -z "$SPHINX_BUILD"],
[AC_MSG_ERROR([The Sphinx Python package must be installed to generate HTML documentation.])])
libbson-1.9.2/build/autotools/SetupLibtool.m4 0000664 0000000 0000000 00000000111 13225757660 0021200 0 ustar 00root root 0000000 0000000 LT_PREREQ([2.2])
AC_DISABLE_STATIC
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
libbson-1.9.2/build/autotools/Versions.m4 0000664 0000000 0000000 00000003352 13225757660 0020375 0 ustar 00root root 0000000 0000000 BSON_CURRENT_FILE=${srcdir}/VERSION_CURRENT
BSON_VERSION=$(cat $BSON_CURRENT_FILE)
# Ensure newline for "cut" implementations that need it, e.g. HP-UX.
BSON_MAJOR_VERSION=$( (cat $BSON_CURRENT_FILE; echo) | cut -d- -f1 | cut -d. -f1 )
BSON_MINOR_VERSION=$( (cat $BSON_CURRENT_FILE; echo) | cut -d- -f1 | cut -d. -f2 )
BSON_MICRO_VERSION=$( (cat $BSON_CURRENT_FILE; echo) | cut -d- -f1 | cut -d. -f3 )
BSON_PRERELEASE_VERSION=$(cut -s -d- -f2 $BSON_CURRENT_FILE)
AC_SUBST(BSON_VERSION)
AC_SUBST(BSON_MAJOR_VERSION)
AC_SUBST(BSON_MINOR_VERSION)
AC_SUBST(BSON_MICRO_VERSION)
AC_SUBST(BSON_PRERELEASE_VERSION)
BSON_RELEASED_FILE=${srcdir}/VERSION_RELEASED
BSON_RELEASED_VERSION=$(cat $BSON_RELEASED_FILE)
BSON_RELEASED_MAJOR_VERSION=$(cut -d- -f1 $BSON_RELEASED_FILE | cut -d. -f1)
BSON_RELEASED_MINOR_VERSION=$(cut -d- -f1 $BSON_RELEASED_FILE | cut -d. -f2)
BSON_RELEASED_MICRO_VERSION=$(cut -d- -f1 $BSON_RELEASED_FILE | cut -d. -f3)
BSON_RELEASED_PRERELEASE_VERSION=$(cut -s -d- -f2 $BSON_RELEASED_FILE)
AC_SUBST(BSON_RELEASED_VERSION)
AC_SUBST(BSON_RELEASED_MAJOR_VERSION)
AC_SUBST(BSON_RELEASED_MINOR_VERSION)
AC_SUBST(BSON_RELEASED_MICRO_VERSION)
AC_SUBST(BSON_RELEASED_PRERELEASE_VERSION)
AC_MSG_NOTICE([Current version (from VERSION_CURRENT file): $BSON_VERSION])
if test "x$BSON_RELEASED_PRERELEASE_VERSION" != "x"; then
AC_ERROR([RELEASED_VERSION file has prerelease version $BSON_RELEASED_VERSION])
fi
if test "x$BSON_VERSION" != "x$BSON_RELEASED_VERSION"; then
AC_MSG_NOTICE([Most recent release (from VERSION_RELEASED file): $BSON_RELEASED_VERSION])
if test "x$BSON_PRERELEASE_VERSION" = "x"; then
AC_ERROR([Current version ($BSON_PRERELEASE_VERSION) must be a prerelease (with "-dev", "-beta", etc.) or equal to previous release])
fi
fi
libbson-1.9.2/build/autotools/m4/ 0000775 0000000 0000000 00000000000 13225757660 0016640 5 ustar 00root root 0000000 0000000 libbson-1.9.2/build/autotools/m4/.gitignore 0000664 0000000 0000000 00000000077 13225757660 0020634 0 ustar 00root root 0000000 0000000 lt~obsolete.m4
ltoptions.m4
ltsugar.m4
ltversion.m4
libtool.m4
libbson-1.9.2/build/autotools/m4/ac_check_typedef.m4 0000664 0000000 0000000 00000002640 13225757660 0022344 0 ustar 00root root 0000000 0000000 dnl @synopsis AC_CHECK_TYPEDEF_(TYPEDEF, HEADER [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]])
dnl
dnl check if the given typedef-name is recognized as a type. The trick
dnl is to use a sizeof(TYPEDEF) and see if the compiler is happy with
dnl that.
dnl
dnl this can be thought of as a mixture of
dnl AC_CHECK_TYPE(TYPEDEF,DEFAULT) and
dnl AC_CHECK_LIB(LIBRARY,FUNCTION,ACTION-IF-FOUND,ACTION-IF-NOT-FOUND)
dnl
dnl a convenience macro AC_CHECK_TYPEDEF_ is provided that will not
dnl emit any message to the user - it just executes one of the actions.
dnl
dnl @category C
dnl @author Guido U. Draheim
dnl @version 2006-10-13
dnl @license GPLWithACException
AC_DEFUN([AC_CHECK_TYPEDEF_],
[dnl
ac_lib_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
AC_CACHE_VAL(ac_cv_lib_$ac_lib_var,
[ eval "ac_cv_type_$ac_lib_var='not-found'"
ac_cv_check_typedef_header=`echo ifelse([$2], , stddef.h, $2)`
AC_TRY_COMPILE( [#include <$ac_cv_check_typedef_header>],
[int x = sizeof($1); x = x;],
eval "ac_cv_type_$ac_lib_var=yes" ,
eval "ac_cv_type_$ac_lib_var=no" )
if test `eval echo '$ac_cv_type_'$ac_lib_var` = "no" ; then
ifelse([$4], , :, $4)
else
ifelse([$3], , :, $3)
fi
])])
dnl AC_CHECK_TYPEDEF(TYPEDEF, HEADER [, ACTION-IF-FOUND,
dnl [, ACTION-IF-NOT-FOUND ]])
AC_DEFUN([AC_CHECK_TYPEDEF],
[dnl
AC_MSG_CHECKING([for $1 in $2])
AC_CHECK_TYPEDEF_($1,$2,AC_MSG_RESULT(yes),AC_MSG_RESULT(no))dnl
])
libbson-1.9.2/build/autotools/m4/ac_compile_check_sizeof.m4 0000664 0000000 0000000 00000001431 13225757660 0023710 0 ustar 00root root 0000000 0000000 AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
[
dnl The name to #define.
define(AC_TYPE_NAME, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
dnl The cache variable name.
define(AC_CV_NAME, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
AC_MSG_CHECKING(size of $1)
AC_CACHE_VAL(AC_CV_NAME,
[for ac_size in 4 8 1 2 16 $2 ; do # List sizes in rough order of prevalence.
AC_TRY_COMPILE([#include "confdefs.h"
#include
$2
], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
if test x$AC_CV_NAME != x ; then break; fi
done
])
if test x$AC_CV_NAME = x ; then
AC_MSG_ERROR([cannot determine a size for $1])
fi
AC_MSG_RESULT($AC_CV_NAME)
AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
undefine([AC_TYPE_NAME])dnl
undefine([AC_CV_NAME])dnl
])
libbson-1.9.2/build/autotools/m4/ac_create_stdint_h.m4 0000664 0000000 0000000 00000036622 13225757660 0022715 0 ustar 00root root 0000000 0000000 dnl @synopsis AC_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])]
dnl
dnl the "ISO C9X: 7.18 Integer types " section requires the
dnl existence of an include file that defines a set of
dnl typedefs, especially uint8_t,int32_t,uintptr_t. Many older
dnl installations will not provide this file, but some will have the
dnl very same definitions in . In other enviroments we can
dnl use the inet-types in which would define the typedefs
dnl int8_t and u_int8_t respectivly.
dnl
dnl This macros will create a local "_stdint.h" or the headerfile given
dnl as an argument. In many cases that file will just have a singular
dnl "#include " or "#include " statement, while
dnl in other environments it will provide the set of basic 'stdint's
dnl defined:
dnl int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t
dnl int_least32_t.. int_fast32_t.. intmax_t which may or may not rely
dnl on the definitions of other files, or using the
dnl AC_COMPILE_CHECK_SIZEOF macro to determine the actual sizeof each
dnl type.
dnl
dnl if your header files require the stdint-types you will want to
dnl create an installable file mylib-int.h that all your other
dnl installable header may include. So if you have a library package
dnl named "mylib", just use
dnl
dnl AC_CREATE_STDINT_H(mylib-int.h)
dnl
dnl in configure.in and go to install that very header file in
dnl Makefile.am along with the other headers (mylib.h) - and the
dnl mylib-specific headers can simply use "#include " to
dnl obtain the stdint-types.
dnl
dnl Remember, if the system already had a valid , the
dnl generated file will include it directly. No need for fuzzy
dnl HAVE_STDINT_H things...
dnl
dnl (note also the newer variant AX_CREATE_STDINT_H of this macro)
dnl
dnl @category C
dnl @author Guido U. Draheim
dnl @version 2003-05-21
dnl @license GPLWithACException
AC_DEFUN([AC_CREATE_STDINT_H],
[# ------ AC CREATE STDINT H -------------------------------------
AC_MSG_CHECKING([for stdint-types....])
ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)`
if test "$ac_stdint_h" = "stdint.h" ; then
AC_MSG_RESULT("(are you sure you want them in ./stdint.h?)")
elif test "$ac_stdint_h" = "inttypes.h" ; then
AC_MSG_RESULT("(are you sure you want them in ./inttypes.h?)")
else
AC_MSG_RESULT("(putting them into $ac_stdint_h)")
mkdir -p $(dirname "$ac_stdint_h")
fi
inttype_headers=`echo inttypes.h sys/inttypes.h sys/inttypes.h $2 \
| sed -e 's/,/ /g'`
ac_cv_header_stdint_x="no-file"
ac_cv_header_stdint_o="no-file"
ac_cv_header_stdint_u="no-file"
for i in stdint.h $inttype_headers ; do
unset ac_cv_type_uintptr_t
unset ac_cv_type_uint64_t
_AC_CHECK_TYPE_NEW(uintptr_t,[ac_cv_header_stdint_x=$i],dnl
continue,[#include <$i>])
AC_CHECK_TYPE(uint64_t,[and64="(uint64_t too)"],[and64=""],[#include<$i>])
AC_MSG_RESULT(... seen our uintptr_t in $i $and64)
break;
done
if test "$ac_cv_header_stdint_x" = "no-file" ; then
for i in stdint.h $inttype_headers ; do
unset ac_cv_type_uint32_t
unset ac_cv_type_uint64_t
AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],dnl
continue,[#include <$i>])
AC_CHECK_TYPE(uint64_t,[and64="(uint64_t too)"],[and64=""],[#include<$i>])
AC_MSG_RESULT(... seen our uint32_t in $i $and64)
break;
done
if test "$ac_cv_header_stdint_o" = "no-file" ; then
for i in sys/types.h $inttype_headers ; do
unset ac_cv_type_u_int32_t
unset ac_cv_type_u_int64_t
AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],dnl
continue,[#include <$i>])
AC_CHECK_TYPE(uint64_t,[and64="(u_int64_t too)"],[and64=""],[#include<$i>])
AC_MSG_RESULT(... seen our u_int32_t in $i $and64)
break;
done
fi
fi
# ----------------- DONE inttypes.h checks MAYBE C basic types --------
if test "$ac_cv_header_stdint_x" = "no-file" ; then
AC_COMPILE_CHECK_SIZEOF(char)
AC_COMPILE_CHECK_SIZEOF(short)
AC_COMPILE_CHECK_SIZEOF(int)
AC_COMPILE_CHECK_SIZEOF(long)
AC_COMPILE_CHECK_SIZEOF(void*)
ac_cv_header_stdint_test="yes"
else
ac_cv_header_stdint_test="no"
fi
# ----------------- DONE inttypes.h checks START header -------------
_ac_stdint_h=AS_TR_CPP(_$ac_stdint_h)
AC_MSG_RESULT(creating $ac_stdint_h : $_ac_stdint_h)
echo "#ifndef" $_ac_stdint_h >$ac_stdint_h
echo "#define" $_ac_stdint_h "1" >>$ac_stdint_h
echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint_h
echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint_h
if test "$GCC" = "yes" ; then
echo "/* generated using a gnu compiler version" `$CC --version` "*/" \
>>$ac_stdint_h
else
echo "/* generated using $CC */" >>$ac_stdint_h
fi
echo "" >>$ac_stdint_h
if test "$ac_cv_header_stdint_x" != "no-file" ; then
ac_cv_header_stdint="$ac_cv_header_stdint_x"
elif test "$ac_cv_header_stdint_o" != "no-file" ; then
ac_cv_header_stdint="$ac_cv_header_stdint_o"
elif test "$ac_cv_header_stdint_u" != "no-file" ; then
ac_cv_header_stdint="$ac_cv_header_stdint_u"
else
ac_cv_header_stdint="stddef.h"
fi
# ----------------- See if int_least and int_fast types are present
unset ac_cv_type_int_least32_t
unset ac_cv_type_int_fast32_t
AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>])
AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>])
if test "$ac_cv_header_stdint" != "stddef.h" ; then
if test "$ac_cv_header_stdint" != "stdint.h" ; then
AC_MSG_RESULT(..adding include stddef.h)
echo "#include " >>$ac_stdint_h
fi ; fi
AC_MSG_RESULT(..adding include $ac_cv_header_stdint)
echo "#include <$ac_cv_header_stdint>" >>$ac_stdint_h
echo "" >>$ac_stdint_h
# ----------------- DONE header START basic int types -------------
if test "$ac_cv_header_stdint_x" = "no-file" ; then
AC_MSG_RESULT(... need to look at C basic types)
dnl ac_cv_header_stdint_test="yes" # moved up before creating the file
else
AC_MSG_RESULT(... seen good stdint.h inttypes)
dnl ac_cv_header_stdint_test="no" # moved up before creating the file
fi
if test "$ac_cv_header_stdint_u" != "no-file" ; then
AC_MSG_RESULT(... seen bsd/sysv typedefs)
cat >>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h < 199901L
#ifndef _HAVE_UINT64_T
#define _HAVE_UINT64_T
typedef long long int64_t;
typedef unsigned long long uint64_t;
#endif
#elif !defined __STRICT_ANSI__
#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__
#ifndef _HAVE_UINT64_T
#define _HAVE_UINT64_T
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#endif
#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__
dnl /* note: all ELF-systems seem to have loff-support which needs 64-bit */
#if !defined _NO_LONGLONG
#ifndef _HAVE_UINT64_T
#define _HAVE_UINT64_T
typedef long long int64_t;
typedef unsigned long long uint64_t;
#endif
#endif
#elif defined __alpha || (defined __mips && defined _ABIN32)
#if !defined _NO_LONGLONG
#ifndef _HAVE_UINT64_T
#define _HAVE_UINT64_T
typedef long int64_t;
typedef unsigned long uint64_t;
#endif
#endif
/* compiler/cpu type ... or just ISO C99 */
#endif
#endif
EOF
# plus a default 64-bit for systems that are likely to be 64-bit ready
case "$ac_cv_sizeof_x:$ac_cv_sizeof_voidp:$ac_cv_sizeof_long" in
1:2:8:8) AC_MSG_RESULT(..adding uint64_t default, normal 64-bit system)
cat >>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <>$ac_stdint_h <