mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-06-24 21:51:32 +02:00
Declare environ if the system does not do so
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.
This commit is contained in:
parent
1fb6c3f4ce
commit
44824aca3c
@ -194,6 +194,10 @@ AC_CHECK_DECL([F_CLOSEM], [
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
AC_CHECK_DECLS([environ], [], [], [[
|
||||||
|
#include <unistd.h>
|
||||||
|
]])
|
||||||
|
|
||||||
AC_CACHE_CHECK([for GNU .init_array section support],
|
AC_CACHE_CHECK([for GNU .init_array section support],
|
||||||
[libbsd_cv_gnu_init_array_support], [
|
[libbsd_cv_gnu_init_array_support], [
|
||||||
AC_RUN_IFELSE([
|
AC_RUN_IFELSE([
|
||||||
|
@ -33,6 +33,10 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "local-link.h"
|
#include "local-link.h"
|
||||||
|
|
||||||
|
#if !HAVE_DECL_ENVIRON
|
||||||
|
extern char **environ;
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
/* Original value. */
|
/* Original value. */
|
||||||
const char *arg0;
|
const char *arg0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user