[Git][ghc/ghc][master] Split `FP_CHECK_PTHREADS` and move part to RTS configure

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed Oct 11 20:03:19 UTC 2023



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
58f3babf by John Ericson at 2023-10-11T16:02:48-04:00
Split `FP_CHECK_PTHREADS` and move part to RTS configure

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

Progress towards #17191

- - - - -


3 changed files:

- configure.ac
- m4/fp_check_pthreads.m4
- rts/configure.ac


Changes:

=====================================
configure.ac
=====================================
@@ -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])


=====================================
m4/fp_check_pthreads.m4
=====================================
@@ -1,7 +1,10 @@
-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:


=====================================
rts/configure.ac
=====================================
@@ -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])



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/58f3babff6a71649554928d269e8c9e21200305f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/58f3babff6a71649554928d269e8c9e21200305f
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20231011/5a175d8c/attachment-0001.html>


More information about the ghc-commits mailing list