Description: Add -latomic on riscv64
Author: Dirk Eddelbuettel <edd@debian.org>
Bug-Debian: https://bugs.debian.org/1017684
Reviewed-By: Bo YU <tsu.yubo@gmail.com>
Last-Update: 2022-08-22

--- tiledb-r-0.15.0.orig/configure
+++ tiledb-r-0.15.0/configure
@@ -6033,6 +6033,14 @@ printf %s "checking for Darwin x86_64 us
 printf "%s\n" "${CXX17_MACOS}" >&6; }
 fi
 
+## Take care of riscv64 machines and need for -latomic
+if test x"${machine}" = x"riscv64"; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for riscv64 linker adjustment" >&5
+printf %s "checking for riscv64 linker adjustment... " >&6; }
+    TILEDB_LIBS="${TILEDB_LIBS} -latomic"
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${TILEDB_LIBS}" >&5
+printf "%s\n" "${TILEDB_LIBS}" >&6; }
+fi
 
 ## -- Part 3: Check for TileDB --------------------------------------------------
 ##
--- tiledb-r-0.15.0.orig/configure.ac
+++ tiledb-r-0.15.0/configure.ac
@@ -153,6 +153,12 @@ if test x"${uname}" = x"Darwin" -a x"${m
     AC_MSG_RESULT([${CXX17_MACOS}])
 fi
 
+## Take care of riscv64 machines and need for -latomic
+if test x"${machine}" = x"riscv64"; then
+    AC_MSG_CHECKING([for riscv64 linker adjustment])
+    TILEDB_LIBS="${TILEDB_LIBS} -latomic"
+    AC_MSG_RESULT([${TILEDB_LIBS}])
+fi
 
 ## -- Part 3: Check for TileDB --------------------------------------------------
 ##
