Please note that the collector source repository does not contain configure
and similar auto-generated files, thus the full procedure of autoconf-based
-build of `master` branch of the collector (using `master` branch of
-libatomic_ops source repository as well) could look like:
+build of `master` branch of the collector could look like:
git clone git://github.com/ivmai/bdwgc.git
cd bdwgc
make -j
make check
+Cloning of `libatomic_ops` is now optional provided the compiler supports
+atomic intrinsics.
+
If you are getting "syntax error near unexpected token ATOMIC_OPS" during
configure execution, this means pkg.m4 cannot be found, most probably
you should run `pkg-config` once before running `./autogen.sh` (autoreconf).
[], [ AS_IF([test x"$THREADS" != xnone],
[with_libatomic_ops=check], [with_libatomic_ops=none]) ])
+# Check whether compiler atomic intrinsics can be used.
+if test x"$with_libatomic_ops" = xcheck; then
+ AC_MSG_CHECKING(for compiler intrinsics support)
+ old_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $CFLAGS_EXTRA -Iinclude -DGC_BUILTIN_ATOMIC"
+ AC_TRY_RUN([#include "tests/test_atomic_ops.c"],
+ [AC_MSG_RESULT(yes)
+ with_libatomic_ops=none],
+ [AC_MSG_RESULT(no)], [AC_MSG_RESULT(skipped because cross-compiling)])
+ CFLAGS="$old_CFLAGS"
+fi
+
# Check for an external libatomic_ops if the above answer is "yes" or "check".
# If not found, fail on "yes", and convert "check" to "no".
# Note: "syntax error near unexpected token ATOMIC_OPS" reported by configure