Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
-
643ce801
by Julian Ospald at 2025-10-28T18:18:55-04:00
4 changed files:
Changes:
| ... | ... | @@ -12,22 +12,7 @@ AC_DEFUN([FP_CHECK_PTHREAD_LIB], |
| 12 | 12 | dnl
|
| 13 | 13 | dnl Note that it is important that this happens before we AC_CHECK_LIB(thread)
|
| 14 | 14 | AC_MSG_CHECKING(whether -lpthread is needed for pthreads)
|
| 15 | - AC_CHECK_FUNC(pthread_create,
|
|
| 16 | - [
|
|
| 17 | - AC_MSG_RESULT(no)
|
|
| 18 | - UseLibpthread=NO
|
|
| 19 | - ],
|
|
| 20 | - [
|
|
| 21 | - AC_CHECK_LIB(pthread, pthread_create,
|
|
| 22 | - [
|
|
| 23 | - AC_MSG_RESULT(yes)
|
|
| 24 | - UseLibpthread=YES
|
|
| 25 | - ],
|
|
| 26 | - [
|
|
| 27 | - AC_MSG_RESULT([no pthreads support found.])
|
|
| 28 | - UseLibpthread=NO
|
|
| 29 | - ])
|
|
| 30 | - ])
|
|
| 15 | + AC_SEARCH_LIBS([pthread_create],[pthread])
|
|
| 31 | 16 | ])
|
| 32 | 17 | |
| 33 | 18 | # FP_CHECK_PTHREAD_FUNCS
|
| ... | ... | @@ -37,6 +22,7 @@ AC_DEFUN([FP_CHECK_PTHREAD_LIB], |
| 37 | 22 | # `AC_DEFINE`s various C `HAVE_*` macros.
|
| 38 | 23 | AC_DEFUN([FP_CHECK_PTHREAD_FUNCS],
|
| 39 | 24 | [
|
| 25 | + OLD_LIBS=$LIBS
|
|
| 40 | 26 | dnl Setting thread names
|
| 41 | 27 | dnl ~~~~~~~~~~~~~~~~~~~~
|
| 42 | 28 | dnl The portability situation here is complicated:
|
| ... | ... | @@ -123,4 +109,5 @@ AC_DEFUN([FP_CHECK_PTHREAD_FUNCS], |
| 123 | 109 | )
|
| 124 | 110 | |
| 125 | 111 | AC_CHECK_FUNCS_ONCE([pthread_condattr_setclock])
|
| 112 | + LIBS=$OLD_LIBS
|
|
| 126 | 113 | ]) |
| ... | ... | @@ -22,7 +22,7 @@ dnl #define SIZEOF_CHAR 0 |
| 22 | 22 | dnl recently.
|
| 23 | 23 | AC_PREREQ([2.69])
|
| 24 | 24 | |
| 25 | -AC_CONFIG_FILES([ghcplatform.h.top])
|
|
| 25 | +AC_CONFIG_FILES([ghcplatform.h.top rts.buildinfo])
|
|
| 26 | 26 | |
| 27 | 27 | AC_CONFIG_HEADERS([ghcautoconf.h.autoconf])
|
| 28 | 28 | |
| ... | ... | @@ -162,14 +162,7 @@ AC_CHECK_DECLS([program_invocation_short_name], , , |
| 162 | 162 | [#define _GNU_SOURCE 1
|
| 163 | 163 | #include <errno.h>])
|
| 164 | 164 | |
| 165 | -dnl ** check for math library
|
|
| 166 | -dnl Keep that check as early as possible.
|
|
| 167 | -dnl as we need to know whether we need libm
|
|
| 168 | -dnl for math functions or not
|
|
| 169 | -dnl (see https://gitlab.haskell.org/ghc/ghc/issues/3730)
|
|
| 170 | -AS_IF(
|
|
| 171 | - [test "$CABAL_FLAG_libm" = 1],
|
|
| 172 | - [AC_DEFINE([HAVE_LIBM], [1], [Define to 1 if you need to link with libm])])
|
|
| 165 | +AC_SEARCH_LIBS([exp2], [m])
|
|
| 173 | 166 | |
| 174 | 167 | AS_IF([test "$CABAL_FLAG_libbfd" = 1], [FP_WHEN_ENABLED_BFD])
|
| 175 | 168 | |
| ... | ... | @@ -178,10 +171,13 @@ dnl Check for libraries |
| 178 | 171 | dnl ################################################################
|
| 179 | 172 | |
| 180 | 173 | dnl ** check whether we need -ldl to get dlopen()
|
| 181 | -AC_CHECK_LIB([dl], [dlopen])
|
|
| 174 | +AC_SEARCH_LIBS([dlopen], [dl])
|
|
| 182 | 175 | dnl ** check whether we have dlinfo
|
| 183 | 176 | AC_CHECK_FUNCS([dlinfo])
|
| 184 | 177 | |
| 178 | +FP_CHECK_PTHREAD_LIB
|
|
| 179 | + |
|
| 180 | + |
|
| 185 | 181 | dnl --------------------------------------------------
|
| 186 | 182 | dnl * Miscellaneous feature tests
|
| 187 | 183 | dnl --------------------------------------------------
|
| ... | ... | @@ -439,6 +435,11 @@ GHC_IOMANAGER_DEFAULT_AC_DEFINE([IOManagerThreadedDefault], [threaded], |
| 439 | 435 | GHC_IOMANAGER_DEFAULT_AC_DEFINE([IOManagerThreadedDefault], [threaded],
|
| 440 | 436 | [winio], [IOMGR_DEFAULT_THREADED_WINIO])
|
| 441 | 437 | |
| 438 | +dnl ######################################################################
|
|
| 439 | +dnl Generate build-info
|
|
| 440 | +dnl ######################################################################
|
|
| 441 | + |
|
| 442 | +AC_SUBST([EXTRA_LIBS],[` printf " %s " "$LIBS" | sed -E 's/ -l([[^ ]]*)/\1 /g' `])
|
|
| 442 | 443 | |
| 443 | 444 | dnl ** Write config files
|
| 444 | 445 | dnl --------------------------------------------------------------
|
| ... | ... | @@ -487,3 +488,5 @@ cat ghcautoconf.h.autoconf | sed \ |
| 487 | 488 | >> include/ghcautoconf.h
|
| 488 | 489 | echo "#endif /* __GHCAUTOCONF_H__ */" >> include/ghcautoconf.h
|
| 489 | 490 | ]
|
| 491 | + |
|
| 492 | + |
| 1 | +extra-libraries: @EXTRA_LIBS@ |
| ... | ... | @@ -25,24 +25,15 @@ source-repository head |
| 25 | 25 | location: https://gitlab.haskell.org/ghc/ghc.git
|
| 26 | 26 | subdir: rts
|
| 27 | 27 | |
| 28 | -flag libm
|
|
| 29 | - default: False
|
|
| 30 | - manual: True
|
|
| 31 | 28 | flag librt
|
| 32 | 29 | default: False
|
| 33 | 30 | manual: True
|
| 34 | -flag libdl
|
|
| 35 | - default: False
|
|
| 36 | - manual: True
|
|
| 37 | 31 | flag use-system-libffi
|
| 38 | 32 | default: False
|
| 39 | 33 | manual: True
|
| 40 | 34 | flag libffi-adjustors
|
| 41 | 35 | default: False
|
| 42 | 36 | manual: True
|
| 43 | -flag need-pthread
|
|
| 44 | - default: False
|
|
| 45 | - manual: True
|
|
| 46 | 37 | flag libbfd
|
| 47 | 38 | default: False
|
| 48 | 39 | manual: True
|
| ... | ... | @@ -215,13 +206,8 @@ library |
| 215 | 206 | -- that it is ordered correctly with libpthread, since ghc-internal.cabal
|
| 216 | 207 | -- also explicitly lists libc. See #19029.
|
| 217 | 208 | extra-libraries: c
|
| 218 | - if flag(libm)
|
|
| 219 | - -- for ldexp()
|
|
| 220 | - extra-libraries: m
|
|
| 221 | 209 | if flag(librt)
|
| 222 | 210 | extra-libraries: rt
|
| 223 | - if flag(libdl)
|
|
| 224 | - extra-libraries: dl
|
|
| 225 | 211 | if flag(use-system-libffi)
|
| 226 | 212 | extra-libraries: ffi
|
| 227 | 213 | if os(windows)
|
| ... | ... | @@ -241,9 +227,6 @@ library |
| 241 | 227 | -- and also centralizes the versioning.
|
| 242 | 228 | cpp-options: -D_WIN32_WINNT=0x06010000
|
| 243 | 229 | cc-options: -D_WIN32_WINNT=0x06010000
|
| 244 | - if flag(need-pthread)
|
|
| 245 | - -- for pthread_getthreadid_np, pthread_create, ...
|
|
| 246 | - extra-libraries: pthread
|
|
| 247 | 230 | if flag(need-atomic)
|
| 248 | 231 | -- for sub-word-sized atomic operations (#19119)
|
| 249 | 232 | extra-libraries: atomic
|