Index: gettext-tools/configure.ac diff -Nau gettext-tools/configure.ac.orig gettext-tools/configure.ac --- gettext-tools/configure.ac.orig 2004-05-26 12:18:02.593003000 +0200 +++ gettext-tools/configure.ac 2004-05-26 12:23:56.228010000 +0200 @@ -116,6 +116,12 @@ AC_TYPE_MODE_T gt_TYPE_SIG_ATOMIC_T +dnl Checks whether environ is declared in +AC_MSG_CHECKING(environ declared in ) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM(#include , char **e = environ;], + [AC_DEFINE(HAVE_DEFINED_ENVIRON) AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) + dnl Checks for library functions. gl_ALLOCSA AC_FUNC_VPRINTF Index: gettext-tools/configure diff -Nau gettext-tools/configure.orig gettext-tools/configure --- gettext-tools/configure.orig 2004-05-26 12:18:09.468003000 +0200 +++ gettext-tools/configure 2004-05-26 12:28:11.641001000 +0200 @@ -21694,6 +21694,74 @@ +echo "$as_me:$LINENO: checking environ declared in " >&5 +echo $ECHO_N "checking environ declared in ... $ECHO_C" >&6 +if test "${gtext_cv_header_environ_decl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + gtext_cv_header_environ_decl=no + if test $gtext_cv_header_environ_decl = no ; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +char **e = environ; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gtext_cv_header_environ_decl=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + + +fi + +if test $gtext_cv_header_environ_decl != no ; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_DEFINED_ENVIRON 1 +_ACEOF + +fi +echo "$as_me:$LINENO: result: ${gtext_cv_header_environ_decl}" >&5 +echo "${ECHO_T}${gtext_cv_header_environ_decl}" >&6 + + + # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo "$as_me:$LINENO: checking for working alloca.h" >&5 Index: gettext-tools/lib/setenv.c diff -Nau gettext-tools/lib/setenv.c.orig gettext-tools/lib/setenv.c --- gettext-tools/lib/setenv.c.orig 2004-05-26 16:32:57.000000000 +0200 +++ gettext-tools/lib/setenv.c 2004-05-26 16:34:03.000000000 +0200 @@ -41,7 +41,7 @@ #if !_LIBC # define __environ environ -# ifndef HAVE_ENVIRON_DECL +# ifndef HAVE_DEFINED_ENVIRON extern char **environ; # endif #endif Index: gettext-tools/lib/unsetenv.c diff -Nau gettext-tools/lib/unsetenv.c.orig gettext-tools/lib/unsetenv.c --- gettext-tools/lib/unsetenv.c.orig 2004-05-26 16:33:03.000000000 +0200 +++ gettext-tools/lib/unsetenv.c 2004-05-26 16:34:14.000000000 +0200 @@ -36,7 +36,7 @@ #if !_LIBC # define __environ environ -# ifndef HAVE_ENVIRON_DECL +# ifndef HAVE_DEFINED_ENVIRON extern char **environ; # endif #endif Index: gettext-tools/lib/execute.c diff -Nau gettext-tools/lib/execute.c.orig gettext-tools/lib/execute.c --- gettext-tools/lib/execute.c.orig 2004-05-26 16:36:08.000000000 +0200 +++ gettext-tools/lib/execute.c 2004-05-26 16:36:43.000000000 +0200 @@ -194,6 +194,9 @@ dependent which error is reported which way. We treat both cases as equivalent. */ #if HAVE_POSIX_SPAWN +#ifndef HAVE_DEFINED_ENVIRON + extern char **environ; +#endif sigset_t blocked_signals; posix_spawn_file_actions_t actions; bool actions_allocated; Index: gettext-tools/lib/pipe-bidi.c diff -Nau gettext-tools/lib/pipe-bidi.c.orig gettext-tools/lib/pipe-bidi.c --- gettext-tools/lib/pipe-bidi.c.orig 2004-05-26 16:34:40.000000000 +0200 +++ gettext-tools/lib/pipe-bidi.c 2004-05-26 16:36:57.000000000 +0200 @@ -191,6 +191,9 @@ int ifd[2]; int ofd[2]; #if HAVE_POSIX_SPAWN +#ifndef HAVE_DEFINED_ENVIRON + extern char **environ; +#endif sigset_t blocked_signals; posix_spawn_file_actions_t actions; bool actions_allocated; Index: gettext-tools/lib/pipe-in.c diff -Nau gettext-tools/lib/pipe-in.c.orig gettext-tools/lib/pipe-in.c --- gettext-tools/lib/pipe-in.c.orig 2004-05-26 16:34:46.000000000 +0200 +++ gettext-tools/lib/pipe-in.c 2004-05-26 16:37:09.000000000 +0200 @@ -204,6 +204,9 @@ /* Unix API. */ int ifd[2]; #if HAVE_POSIX_SPAWN +#ifndef HAVE_DEFINED_ENVIRON + extern char **environ; +#endif sigset_t blocked_signals; posix_spawn_file_actions_t actions; bool actions_allocated; Index: gettext-tools/lib/pipe-out.c diff -Nau gettext-tools/lib/pipe-out.c.orig gettext-tools/lib/pipe-out.c --- gettext-tools/lib/pipe-out.c.orig 2004-05-26 16:34:53.000000000 +0200 +++ gettext-tools/lib/pipe-out.c 2004-05-26 16:37:16.000000000 +0200 @@ -204,6 +204,9 @@ /* Unix API. */ int ofd[2]; #if HAVE_POSIX_SPAWN +#ifndef HAVE_DEFINED_ENVIRON + extern char **environ; +#endif sigset_t blocked_signals; posix_spawn_file_actions_t actions; bool actions_allocated;