diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-12-23 11:53:25 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-01-11 19:39:32 -0500 |
commit | 247cd336af9b9367697e0b5a7a82c5227f986a97 (patch) | |
tree | 1f0c9f0331b90e526172fe25c860f67ed7b592de /m4/fp_check_environ.m4 | |
parent | 6737c8e1ed67a2ec3f1fa3e91cb279f689d3da6f (diff) | |
download | haskell-247cd336af9b9367697e0b5a7a82c5227f986a97.tar.gz |
rts: Only declare environ when necessary
Previously we would unconditionally provide a declaration for `environ`,
even if `<unistd.h>` already provided one. This would result in
`-Werror` builds failing on some platforms.
Also `#include <unistd.h>` to ensure that the declaration is visible.
Fixes #20861.
Diffstat (limited to 'm4/fp_check_environ.m4')
-rw-r--r-- | m4/fp_check_environ.m4 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/m4/fp_check_environ.m4 b/m4/fp_check_environ.m4 new file mode 100644 index 0000000000..88bf0a52de --- /dev/null +++ b/m4/fp_check_environ.m4 @@ -0,0 +1,14 @@ +# FP_CHECK_ENVIRON +# ----------------- +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 See #20512, #20577, #20861. + dnl-------------------------------------------------------------------- + AC_CHECK_DECLS([environ], [], [], [ + #include <unistd.h> + ]) +]) + |