File: configure

package info (click to toggle)
r-cran-later 1.1.0.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 412 kB
  • sloc: cpp: 1,473; ansic: 1,096; sh: 29; makefile: 2
file content (28 lines) | stat: -rwxr-xr-x 621 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

echo "Running configure script"

# Find compiler
CC=`"${R_HOME}"/bin/R CMD config CC`

# Detect whether -latomic is needed during linking. This is needed on some
# platforms, notably ARM (Raspberry Pi).
echo "#include <stdint.h>
uint64_t v;
int main() {
    return (int)__atomic_load_n(&v, __ATOMIC_ACQUIRE);
}" | ${CC} -x c - -o /dev/null > /dev/null 2>&1

if [ $? -eq 0 ]; then
  echo "-latomic linker flag not needed."
else
  echo "-latomic linker flag needed."
  EXTRA_PKG_LIBS=-latomic
fi


# Write to Makevars
sed -e "s|@extra_pkg_libs@|$EXTRA_PKG_LIBS|" src/Makevars.in > src/Makevars

# Success
exit 0