summaryrefslogtreecommitdiffstats
path: root/gl/m4/setenv.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/setenv.m4')
-rw-r--r--gl/m4/setenv.m423
1 files changed, 13 insertions, 10 deletions
diff --git a/gl/m4/setenv.m4 b/gl/m4/setenv.m4
index 16f9eb55..727e35af 100644
--- a/gl/m4/setenv.m4
+++ b/gl/m4/setenv.m4
@@ -1,8 +1,10 @@
1# setenv.m4 serial 30 1# setenv.m4
2dnl Copyright (C) 2001-2004, 2006-2023 Free Software Foundation, Inc. 2# serial 35
3dnl Copyright (C) 2001-2004, 2006-2025 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7dnl This file is offered as-is, without any warranty.
6 8
7AC_DEFUN([gl_FUNC_SETENV], 9AC_DEFUN([gl_FUNC_SETENV],
8[ 10[
@@ -35,12 +37,12 @@ AC_DEFUN([gl_FUNC_SETENV],
35 ]])], 37 ]])],
36 [gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no], 38 [gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no],
37 [case "$host_os" in 39 [case "$host_os" in
38 # Guess yes on glibc systems. 40 # Guess yes on glibc systems.
39 *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;; 41 *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;;
40 # Guess yes on musl systems. 42 # Guess yes on musl systems.
41 *-musl*) gl_cv_func_setenv_works="guessing yes" ;; 43 *-musl* | midipix*) gl_cv_func_setenv_works="guessing yes" ;;
42 # If we don't know, obey --enable-cross-guesses. 44 # If we don't know, obey --enable-cross-guesses.
43 *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;; 45 *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;;
44 esac 46 esac
45 ])]) 47 ])])
46 case "$gl_cv_func_setenv_works" in 48 case "$gl_cv_func_setenv_works" in
@@ -151,11 +153,11 @@ int unsetenv (const char *name);
151# Prerequisites of lib/setenv.c. 153# Prerequisites of lib/setenv.c.
152AC_DEFUN([gl_PREREQ_SETENV], 154AC_DEFUN([gl_PREREQ_SETENV],
153[ 155[
154 AC_REQUIRE([AC_FUNC_ALLOCA])
155 AC_REQUIRE([gl_ENVIRON]) 156 AC_REQUIRE([gl_ENVIRON])
156 AC_CHECK_HEADERS_ONCE([unistd.h]) 157 AC_CHECK_HEADERS_ONCE([unistd.h])
157 AC_CHECK_HEADERS([search.h]) 158 AC_CHECK_HEADERS([search.h])
158 AC_CHECK_FUNCS([tsearch]) 159 AC_CHECK_DECLS_ONCE([_putenv])
160 gl_CHECK_FUNCS_ANDROID([tsearch], [[#include <search.h>]])
159]) 161])
160 162
161# Prerequisites of lib/unsetenv.c. 163# Prerequisites of lib/unsetenv.c.
@@ -163,4 +165,5 @@ AC_DEFUN([gl_PREREQ_UNSETENV],
163[ 165[
164 AC_REQUIRE([gl_ENVIRON]) 166 AC_REQUIRE([gl_ENVIRON])
165 AC_CHECK_HEADERS_ONCE([unistd.h]) 167 AC_CHECK_HEADERS_ONCE([unistd.h])
168 AC_CHECK_DECLS_ONCE([_putenv])
166]) 169])