Ticket #4495: check if environ is defined to fix redefinition on Alpine

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
This commit is contained in:
Yury V. Zaytsev 2024-10-08 11:52:37 +02:00
parent dd12be7c82
commit b8e2a376e3
2 changed files with 5 additions and 2 deletions

View File

@ -346,6 +346,10 @@ dnl ############################################################################
dnl OS specific stuff dnl OS specific stuff
dnl ############################################################################ dnl ############################################################################
AC_CHECK_DECLS([environ], , ,
[ #include <unistd.h>
#include <stdlib.h> ])
case $host_os in case $host_os in
*os400) *os400)
AC_PATH_PROG([PERL], [perl], [/QOpenSys/pkgs/bin/perl]) AC_PATH_PROG([PERL], [perl], [/QOpenSys/pkgs/bin/perl])

View File

@ -54,8 +54,7 @@
/*** global variables ****************************************************************************/ /*** global variables ****************************************************************************/
/* Linux declares environ in <unistd.h>, so don't repeat it here. */ #if !HAVE_DECL_ENVIRON
#if (!(defined(__linux__) && defined (__USE_GNU)) && !defined(__CYGWIN__))
extern char **environ; extern char **environ;
#endif #endif