Silence -Wunused-const-variable warnings in Gnulib code.
[gnulib.git] / m4 / secure_getenv.m4
blob7adc65abfcc8b8757d8327ca5395bb3c95b4f248
1 # secure_getenv.m4
2 # serial 2
3 dnl Copyright 2013-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 AC_DEFUN([gl_FUNC_SECURE_GETENV],
10   dnl Persuade glibc <stdlib.h> to declare secure_getenv().
11   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
13   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
14   AC_CHECK_FUNCS_ONCE([secure_getenv])
15   if test $ac_cv_func_secure_getenv = no; then
16     HAVE_SECURE_GETENV=0
17   fi
20 # Prerequisites of lib/secure_getenv.c.
21 AC_DEFUN([gl_PREREQ_SECURE_GETENV], [
22   AC_CHECK_FUNCS([__secure_getenv])
23   if test $ac_cv_func___secure_getenv = no; then
24     gl_CHECK_FUNCS_ANDROID([issetugid], [[#include <unistd.h>]])
25   fi
26   AC_CHECK_FUNCS_ONCE([getuid geteuid getgid getegid])