summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBen Gamari <ben@well-typed.com>2022-04-01 13:28:22 -0400
committerBen Gamari <ben@smart-cactus.org>2022-04-07 09:42:42 -0400
commitfcef9a175f810e7bfccbae9bf9e79b2b95da17ab (patch)
treef6abbd79400d296cd03a3022e133c2b48dc9e951 /m4
parent9eeaeca4e95d58f362737bceead0ae2e16bcbbbb (diff)
downloadhaskell-fcef9a175f810e7bfccbae9bf9e79b2b95da17ab.tar.gz
configure: Make environ decl check more robust
Some platforms (e.g. Windows/clang64) declare `environ` in `<stdlib.h>`, not `<unistd.h>`
Diffstat (limited to 'm4')
-rw-r--r--m4/fp_check_environ.m47
1 files changed, 5 insertions, 2 deletions
diff --git a/m4/fp_check_environ.m4 b/m4/fp_check_environ.m4
index 88bf0a52de..f0daedc9c0 100644
--- a/m4/fp_check_environ.m4
+++ b/m4/fp_check_environ.m4
@@ -4,11 +4,14 @@ AC_DEFUN([FP_CHECK_ENVIRON],
[
dnl--------------------------------------------------------------------
dnl * Check whether the libc headers provide a declaration for the
- dnl environ symbol. If not then we will provide one in RtsSymbols.c.
+ dnl environ symbol. If not then we will provide one in RtsSymbols.c.
dnl See #20512, #20577, #20861.
+ dnl
+ dnl N.B. Windows declares environ in <stdlib.h>; most others declare it
+ dnl in <unistd.h>.
dnl--------------------------------------------------------------------
AC_CHECK_DECLS([environ], [], [], [
+ #include <stdlib.h>
#include <unistd.h>
])
])
-