-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathconfigure.ac
38 lines (34 loc) · 920 Bytes
/
configure.ac
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
29
30
31
32
33
34
35
36
37
38
AC_INIT([poismf], 0.4.0)
AC_CHECK_LIB(atomic, __atomic_exchange, [HAS_ATOMIC=TRUE], [HAS_ATOMIC=FALSE])
if test "$HAS_ATOMIC" = "TRUE"; then
OMP_PLUS_ATOMIC_L="\$(SHLIB_OPENMP_CFLAGS) -latomic"
OMP_PLUS_ATOMIC="\$(SHLIB_OPENMP_CFLAGS)"
else
OMP_PLUS_ATOMIC_L=""
OMP_PLUS_ATOMIC=""
fi
AC_SUBST(OMP_PLUS_ATOMIC_L)
AC_SUBST(OMP_PLUS_ATOMIC)
CC=`"${R_HOME}/bin/R" CMD config CC`
CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS`
CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS`
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fno-math-errno"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]])],
[FNE_FLAG="-fno-math-errno"],
[FNE_FLAG=""]
)
CFLAGS="$OLD_CFLAGS"
AC_SUBST(FNE_FLAG)
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fno-trapping-math"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]])],
[FNTP_FLAG="-fno-trapping-math"],
[FNTP_FLAG=""]
)
CFLAGS="$OLD_CFLAGS"
AC_SUBST(FNTP_FLAG)
AC_CONFIG_FILES([src/Makevars])
AC_OUTPUT