2 dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
9 dnl Check whether putenv ("FOO") removes FOO from the environment.
10 dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
12 AC_DEFUN([gl_FUNC_PUTENV],
13 [AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv,
19 if (putenv ("CONFTEST_putenv=val"))
22 /* Try to remove it. */
23 if (putenv ("CONFTEST_putenv"))
26 /* Make sure it was deleted. */
27 if (getenv ("CONFTEST_putenv") != 0)
33 jm_cv_func_svid_putenv=yes,
34 jm_cv_func_svid_putenv=no,
35 dnl When crosscompiling, assume putenv is broken.
36 jm_cv_func_svid_putenv=no)
38 if test $jm_cv_func_svid_putenv = no; then
40 AC_DEFINE(putenv, rpl_putenv,
41 [Define to rpl_putenv if the replacement function should be used.])