The environ variable is supposed to be defined by the code using it, but
on glibc-based systems it will get defined if we request it, by including
<unistd.h> and defining _GNU_SOURCE.
#include <fcntl.h>
]])
+AC_CHECK_DECLS([environ], [], [], [[
+#include <unistd.h>
+]])
+
AC_CACHE_CHECK([for GNU .init_array section support],
[libbsd_cv_gnu_init_array_support], [
AC_RUN_IFELSE([
#include <string.h>
#include "local-link.h"
+#if !HAVE_DECL_ENVIRON
+extern char **environ;
+#endif
+
static struct {
/* Original value. */
const char *arg0;