@@ -43,6 +43,10 @@ if is_true USE_NINJA; then
4343 bash " $EVG_DIR /ensure-ninja.sh"
4444fi
4545
46+ # Apply patches to fix compile on RHEL 6.2. TODO: try to remove once RHEL 6.2 is dropped (MONGOCRYPT-688).
47+ run_chdir " $mongoc_src_dir " git apply " $LIBMONGOCRYPT_DIR /etc/libbson-remove-GCC-diagnostic-pragma.patch"
48+ run_chdir " $mongoc_src_dir " git apply " $LIBMONGOCRYPT_DIR /etc/mongo-common-test-harness.patch"
49+
4650echo " Building libbson ..."
4751libbson_install_dir=" $pkgconfig_tests_root /install/libbson"
4852build_dir=" $mongoc_src_dir /_build"
@@ -52,7 +56,7 @@ run_cmake -DENABLE_MONGOC=OFF \
5256 -H" $mongoc_src_dir " \
5357 -B" $build_dir "
5458run_cmake --build " $build_dir " --target install --config RelWithDebInfo
55- libbson_pkg_config_path=" $( native_path " $( dirname " $( find " $libbson_install_dir " -name libbson-1.0 .pc) " ) " ) "
59+ libbson_pkg_config_path=" $( native_path " $( dirname " $( find " $libbson_install_dir " -name bson2 .pc) " ) " ) "
5660echo " Building libbson ... done"
5761
5862echo " Build libmongocrypt, static linking against libbson and configured for the PPA ..."
@@ -79,7 +83,7 @@ pkg-config --debug --print-errors --exists libmongocrypt
7983echo " Validating pkg-config scripts ... done"
8084
8185echo " Build example-state-machine, static linking against libmongocrypt ..."
82- gcc $( pkg-config --cflags libmongocrypt-static libbson -static-1.0 ) \
86+ gcc $( pkg-config --cflags libmongocrypt-static bson2 -static) \
8387 -o " $pkgconfig_tests_root /example-state-machine" \
8488 " $LIBMONGOCRYPT_DIR /test/example-state-machine.c" \
8589 $( pkg-config --libs libmongocrypt-static)
@@ -95,7 +99,7 @@ command "$pkgconfig_tests_root/example-no-bson"
9599echo " Build example-no-bson, static linking against libmongocrypt ... done"
96100
97101echo " Build example-state-machine, dynamic linking against libmongocrypt ..."
98- gcc $( pkg-config --cflags libmongocrypt libbson -static-1.0 ) \
102+ gcc $( pkg-config --cflags libmongocrypt bson2 -static) \
99103 -o " $pkgconfig_tests_root /example-state-machine" \
100104 " $LIBMONGOCRYPT_DIR /test/example-state-machine.c" \
101105 $( pkg-config --libs libmongocrypt)
@@ -127,7 +131,7 @@ run_cmake --build "$build_dir" --target install --config RelWithDebInfo
127131echo " Build libmongocrypt, dynamic linking against libbson ... done"
128132
129133echo " Build example-state-machine, static linking against libmongocrypt ..."
130- gcc $( pkg-config --cflags libmongocrypt-static libbson -static-1.0 ) \
134+ gcc $( pkg-config --cflags libmongocrypt-static bson2 -static) \
131135 -o " $pkgconfig_tests_root /example-state-machine" \
132136 " $LIBMONGOCRYPT_DIR /test/example-state-machine.c" \
133137 $( pkg-config --libs libmongocrypt-static)
@@ -146,7 +150,7 @@ env LD_LIBRARY_PATH="$libbson_install_dir/lib:/$libbson_install_dir/lib64" \
146150echo " Build example-no-bson, static linking against libmongocrypt ... done"
147151
148152echo " Build example-state-machine, dynamic linking against libmongocrypt ..."
149- gcc $( pkg-config --cflags libmongocrypt libbson -static-1.0 ) \
153+ gcc $( pkg-config --cflags libmongocrypt bson2 -static) \
150154 -o " $pkgconfig_tests_root /example-state-machine" \
151155 " $LIBMONGOCRYPT_DIR /test/example-state-machine.c" \
152156 $( pkg-config --libs libmongocrypt)
0 commit comments