Skip to content
Snippets Groups Projects
Commit 5cf04f58 authored by John Ericson's avatar John Ericson Committed by Marge Bot
Browse files

Move/Copy more `AC_DEFINE` to RTS config

Only exception is the LLVM version macros, which are used for GHC
itself.
parent 5f4bccab
No related branches found
No related tags found
No related merge requests found
......@@ -138,27 +138,6 @@ if test "$EnableDistroToolchain" = "YES"; then
TarballsAutodownload=NO
fi
AC_ARG_ENABLE(asserts-all-ways,
[AS_HELP_STRING([--enable-asserts-all-ways],
[Usually ASSERTs are only compiled in the DEBUG way,
this will enable them in all ways.])],
[FP_CAPITALIZE_YES_NO(["$enableval"], [EnableAssertsAllWays])],
[EnableAssertsAllWays=NO]
)
if test "$enable_asserts_all_ways" = "yes" ; then
AC_DEFINE([USE_ASSERTS_ALL_WAYS], [1], [Compile-in ASSERTs in all ways.])
fi
AC_ARG_ENABLE(native-io-manager,
[AS_HELP_STRING([--enable-native-io-manager],
[Enable the native I/O manager by default.])],
[FP_CAPITALIZE_YES_NO(["$enableval"], [EnableNativeIOManager])],
[EnableNativeIOManager=NO]
)
if test "$EnableNativeIOManager" = "YES"; then
AC_DEFINE_UNQUOTED([DEFAULT_NATIVE_IO_MANAGER], [1], [Enable Native I/O manager as default.])
fi
AC_ARG_ENABLE(ghc-toolchain,
[AS_HELP_STRING([--enable-ghc-toolchain],
[Whether to use the newer ghc-toolchain tool to configure ghc targets])],
......@@ -617,12 +596,15 @@ dnl unregisterised, Sparc, and PPC backends. Also determines whether
dnl linking to libatomic is required for atomic operations, e.g. on
dnl RISCV64 GCC.
FP_CC_SUPPORTS__ATOMICS
if test "$need_latomic" = 1; then
AC_SUBST([NeedLibatomic],[YES])
else
AC_SUBST([NeedLibatomic],[NO])
fi
dnl ** look to see if we have a C compiler using an llvm back end.
dnl
FP_CC_LLVM_BACKEND
AS_IF([test x"$CcLlvmBackend" = x"YES"],
[AC_DEFINE([CC_LLVM_BACKEND], [1], [Define (to 1) if C compiler has an LLVM back end])])
AC_SUBST(CcLlvmBackend)
FPTOOLS_SET_C_LD_FLAGS([target],[CFLAGS],[LDFLAGS],[IGNORE_LINKER_LD_FLAGS],[CPPFLAGS])
......
......@@ -61,12 +61,4 @@ AC_DEFUN([FP_CC_SUPPORTS__ATOMICS],
AC_MSG_RESULT(no)
AC_MSG_ERROR([C compiler needs to support __atomic primitives.])
])
AC_DEFINE([HAVE_C11_ATOMICS], [1], [Does C compiler support __atomic primitives?])
if test "$need_latomic" = 1; then
AC_SUBST([NeedLibatomic],[YES])
else
AC_SUBST([NeedLibatomic],[NO])
fi
AC_DEFINE_UNQUOTED([NEED_ATOMIC_LIB], [$need_latomic],
[Define to 1 if we need -latomic.])
])
......@@ -162,8 +162,6 @@ AC_DEFUN([GHC_SUBSECTIONS_VIA_SYMBOLS],
TargetHasSubsectionsViaSymbols=NO
else
TargetHasSubsectionsViaSymbols=YES
AC_DEFINE([HAVE_SUBSECTIONS_VIA_SYMBOLS],[1],
[Define to 1 if Apple-style dead-stripping is supported.])
fi
],
[TargetHasSubsectionsViaSymbols=NO
......
......@@ -24,15 +24,63 @@ AC_PREREQ([2.69])
AC_CONFIG_HEADERS([ghcautoconf.h.autoconf])
AC_ARG_ENABLE(asserts-all-ways,
[AS_HELP_STRING([--enable-asserts-all-ways],
[Usually ASSERTs are only compiled in the DEBUG way,
this will enable them in all ways.])],
[FP_CAPITALIZE_YES_NO(["$enableval"], [EnableAssertsAllWays])],
[EnableAssertsAllWays=NO]
)
if test "$enable_asserts_all_ways" = "yes" ; then
AC_DEFINE([USE_ASSERTS_ALL_WAYS], [1], [Compile-in ASSERTs in all ways.])
fi
AC_ARG_ENABLE(native-io-manager,
[AS_HELP_STRING([--enable-native-io-manager],
[Enable the native I/O manager by default.])],
[FP_CAPITALIZE_YES_NO(["$enableval"], [EnableNativeIOManager])],
[EnableNativeIOManager=NO]
)
if test "$EnableNativeIOManager" = "YES"; then
AC_DEFINE_UNQUOTED([DEFAULT_NATIVE_IO_MANAGER], [1], [Enable Native I/O manager as default.])
fi
# We have to run these unconditionally, but we may discard their
# results in the following code
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
dnl detect compiler (prefer gcc over clang) and set $CC (unless CC already set),
dnl later CC is copied to CC_STAGE{1,2,3}
AC_PROG_CC([cc gcc clang])
dnl make extensions visible to allow feature-tests to detect them lateron
AC_USE_SYSTEM_EXTENSIONS
dnl ** Used to determine how to compile ghc-prim's atomics.c, used by
dnl unregisterised, Sparc, and PPC backends. Also determines whether
dnl linking to libatomic is required for atomic operations, e.g. on
dnl RISCV64 GCC.
FP_CC_SUPPORTS__ATOMICS
AC_DEFINE([HAVE_C11_ATOMICS], [1], [Does C compiler support __atomic primitives?])
AC_DEFINE_UNQUOTED([NEED_ATOMIC_LIB], [$need_latomic],
[Define to 1 if we need -latomic for sub-word atomic operations.])
dnl ** look to see if we have a C compiler using an llvm back end.
dnl
FP_CC_LLVM_BACKEND
AS_IF([test x"$CcLlvmBackend" = x"YES"],
[AC_DEFINE([CC_LLVM_BACKEND], [1], [Define (to 1) if C compiler has an LLVM back end])])
GHC_CONVERT_PLATFORM_PARTS([host], [Host])
FPTOOLS_SET_PLATFORM_VARS([host], [Host])
FPTOOLS_SET_HASKELL_PLATFORM_VARS([Host])
GHC_SUBSECTIONS_VIA_SYMBOLS
AS_IF([test x"${TargetHasSubsectionsViaSymbols}" = x"YES"],
[AC_DEFINE([HAVE_SUBSECTIONS_VIA_SYMBOLS],[1],
[Define to 1 if Apple-style dead-stripping is supported.])])
dnl --------------------------------------------------
dnl * Platform header file and syscall feature tests
dnl ### checking the state of the local header files and syscalls ###
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment