2 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3 dnl This file is free software, distributed under the terms of the GNU
4 dnl General Public License. As a special exception to the GNU General
5 dnl Public License, this file may be distributed as part of a program
6 dnl that contains a configuration script generated by Autoconf, under
7 dnl the same distribution terms as the rest of that program.
11 dnl Check whether putenv ("FOO") removes FOO from the environment.
12 dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
14 AC_DEFUN([jm_FUNC_PUTENV],
15 [AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv,
21 if (putenv ("CONFTEST_putenv=val"))
24 /* Try to remove it. */
25 if (putenv ("CONFTEST_putenv"))
28 /* Make sure it was deleted. */
29 if (getenv ("CONFTEST_putenv") != 0)
35 jm_cv_func_svid_putenv=yes,
36 jm_cv_func_svid_putenv=no,
37 dnl When crosscompiling, assume putenv is broken.
38 jm_cv_func_svid_putenv=no)
40 if test $jm_cv_func_svid_putenv = no; then
42 AC_DEFINE(putenv, rpl_putenv,
43 [Define to rpl_putenv if the replacement function should be used.])
48 # Prerequisites of lib/putenv.c.
49 AC_DEFUN([gl_PREREQ_PUTENV], [
50 AC_CHECK_HEADERS_ONCE(unistd.h)