Description: Link against libatomic.
 The -latomic flag is no longer provided by the TBB pkg-config file, but it
 is necessary to build on mipsel and m68k.
Author: Doug Torrance <dtorrance@debian.org>
Forwarded: https://github.com/Macaulay2/mathicgb/pull/41
Last-Update: 2022-06-25

--- a/configure.ac
+++ b/configure.ac
@@ -121,6 +121,9 @@
 )
 AS_IF([test "x$with_tbb" == "xno"], [TBB_CFLAGS="-DMATHICGB_NO_TBB"])
 
+AS_IF([test "x$with_tbb" = "xyes" && echo "$TBB_LIBS" | grep "\-latomic"],
+  [], [TBB_LIBS="$TBB_LIBS -latomic"])
+
 dnl ----- The librt dependency
 dnl On Linux TBB calls clock_gettime, which requires librt, but librt is not
 dnl linked in automatically. So we need to check for that.
