summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-07-12 17:26:47 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-07-27 04:47:51 -0400
commit2ce48fe9d1334dadf6fa1411238e52d65b66ba41 (patch)
tree1f48a9e2e2ae3350c3802875bef128327afdf593 /configure.ac
parent246f08ac032392f808c7aa53dd78a96d9b43e63f (diff)
downloadhaskell-2ce48fe9d1334dadf6fa1411238e52d65b66ba41.tar.gz
rts: Break up adjustor logic
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac54
1 files changed, 54 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 38de5953b6..535a0c3b88 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1282,6 +1282,60 @@ case ${TargetOS} in
AC_DEFINE_UNQUOTED([RTS_LINKER_USE_MMAP], [$RtsLinkerUseMmap],
[Use mmap in the runtime linker])
+
+dnl ** Use libffi for adjustors?
+dnl --------------------------------------------------------------
+
+case ${TargetArch} in
+ i386|x86_64)
+ # We have native adjustor support on these platforms
+ HaveNativeAdjustor=yes
+ ;;
+ *)
+ HaveNativeAdjustor=no
+ ;;
+esac
+
+AC_ARG_ENABLE(libffi-adjustors,
+ [AS_HELP_STRING(
+ [--enable-libffi-adjustors],
+ [Force use of libffi for adjustors, even on platforms which have support for more efficient, native adjustors.])],
+ UseLibffiForAdjustors=$enableval,
+ dnl do nothing
+)
+
+AC_MSG_CHECKING([whether to use libffi for adjustors])
+AC_MSG_RESULT([$UseLibffiForAdjustors])
+if test "$UseLibffiForAdjustors" = "yes" ; then
+ # Use libffi is the user explicitly requested it
+ AdjustorType="libffi"
+elif test "$HaveNativeAdjustor" = "yes"; then
+ # Otherwise if we have a native adjustor implementation use that
+ AdjustorType="native"
+else
+ # If we don't have a native adjustor implementation then default to libffi
+ AdjustorType="libffi"
+fi
+
+case "$AdjustorType" in
+libffi)
+ CabalLibffiAdjustors=True
+ UseLibffiForAdjustors=YES
+ ;;
+native)
+ CabalLibffiAdjustors=False
+ UseLibffiForAdjustors=NO
+ ;;
+*)
+ AC_MSG_ERROR([Internal error: Invalid AdjustorType])
+ exit 1
+esac
+
+AC_SUBST([CabalLibffiAdjustors])
+AC_SUBST([UseLibffiForAdjustors])
+
+dnl ** Other RTS features
+dnl --------------------------------------------------------------
FP_FIND_LIBDW
FP_FIND_LIBNUMA