Obtained from: https://github.com/protocolbuffers/protobuf/commit/56b40a8f055cfd05633054aed5d3466a6e058b72 --- configure.ac.orig 2018-07-27 20:30:28 UTC +++ configure.ac @@ -165,6 +165,22 @@ AS_IF([test "$with_zlib" != no], [ ]) AM_CONDITIONAL([HAVE_ZLIB], [test $HAVE_ZLIB = 1]) +dnl On some platforms, std::atomic needs a helper library +AC_MSG_CHECKING(whether -latomic is needed) +AC_LINK_IFELSE([AC_LANG_SOURCE([[ + #include + #include + std::atomic v; + int main() { + return v; + } +]])], STD_ATOMIC_NEED_LIBATOMIC=no, STD_ATOMIC_NEED_LIBATOMIC=yes) +AC_MSG_RESULT($STD_ATOMIC_NEED_LIBATOMIC) +if test "x$STD_ATOMIC_NEED_LIBATOMIC" = xyes; then + LIBATOMIC_LIBS="-latomic" +fi +AC_SUBST([LIBATOMIC_LIBS]) + AS_IF([test "$with_protoc" != "no"], [ PROTOC=$with_protoc AS_IF([test "$with_protoc" = "yes"], [