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

Split `FP_CHECK_PTHREADS` and move part to RTS configure

`NEED_PTHREAD_LIB` is unused since
36093407 (part of the make build
system), and so is no longer defined.

Progress towards #17191
parent 809e7c2d
No related branches found
No related tags found
No related merge requests found
......@@ -1038,7 +1038,8 @@ AC_LINK_IFELSE([AC_LANG_CALL([], [printf\$LDBLStub])],
[Define to 1 if we have printf$LDBLStub (Apple Mac OS >= 10.4, PPC).])
])
FP_CHECK_PTHREADS
FP_CHECK_PTHREAD_LIB
AC_SUBST([UseLibpthread])
GHC_ADJUSTORS_METHOD([Target])
AC_SUBST([UseLibffiForAdjustors])
......
dnl FP_CHECK_PTHREADS
dnl ----------------------------------
dnl Check various aspects of the platform's pthreads support
AC_DEFUN([FP_CHECK_PTHREADS],
# FP_CHECK_PTHREAD_LIB
# ----------------------------------
# Check whether -lpthread is needed for pthread.
#
# Sets variables:
# - UseLibpthread: [YES|NO]
AC_DEFUN([FP_CHECK_PTHREAD_LIB],
[
dnl Some platforms (e.g. Android's Bionic) have pthreads support available
dnl without linking against libpthread. Check whether -lpthread is necessary
......@@ -12,25 +15,28 @@ AC_DEFUN([FP_CHECK_PTHREADS],
AC_CHECK_FUNC(pthread_create,
[
AC_MSG_RESULT(no)
AC_SUBST([UseLibpthread],[NO])
need_lpthread=0
UseLibpthread=NO
],
[
AC_CHECK_LIB(pthread, pthread_create,
[
AC_MSG_RESULT(yes)
AC_SUBST([UseLibpthread],[YES])
need_lpthread=1
UseLibpthread=YES
],
[
AC_SUBST([UseLibpthread],[NO])
AC_MSG_RESULT([no pthreads support found.])
need_lpthread=0
UseLibpthread=NO
])
])
AC_DEFINE_UNQUOTED([NEED_PTHREAD_LIB], [$need_lpthread],
[Define 1 if we need to link code using pthreads with -lpthread])
])
# FP_CHECK_PTHREAD_FUNCS
# ----------------------------------
# Check various aspects of the platform's pthreads support
#
# `AC_DEFINE`s various C `HAVE_*` macros.
AC_DEFUN([FP_CHECK_PTHREAD_FUNCS],
[
dnl Setting thread names
dnl ~~~~~~~~~~~~~~~~~~~~
dnl The portability situation here is complicated:
......
......@@ -33,6 +33,8 @@ GHC_CONVERT_PLATFORM_PARTS([host], [Host])
FPTOOLS_SET_PLATFORM_VARS([host], [Host])
FPTOOLS_SET_HASKELL_PLATFORM_VARS([Host])
FP_CHECK_PTHREAD_FUNCS
dnl ** check for eventfd which is needed by the I/O manager
AC_CHECK_HEADERS([sys/eventfd.h])
AC_CHECK_FUNCS([eventfd])
......
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