Change jm_ to gl_ in AC_DEFINE'd names. Update all uses.
[gnulib.git] / m4 / putenv.m4
1 # putenv.m4 serial 8
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.
8
9 dnl From Jim Meyering.
10 dnl
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.
13
14 AC_DEFUN([gl_FUNC_PUTENV],
15 [AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv,
16   [AC_TRY_RUN([
17     int
18     main ()
19     {
20       /* Put it in env.  */
21       if (putenv ("CONFTEST_putenv=val"))
22         exit (1);
23
24       /* Try to remove it.  */
25       if (putenv ("CONFTEST_putenv"))
26         exit (1);
27
28       /* Make sure it was deleted.  */
29       if (getenv ("CONFTEST_putenv") != 0)
30         exit (1);
31
32       exit (0);
33     }
34               ],
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)
39   ])
40   if test $jm_cv_func_svid_putenv = no; then
41     AC_LIBOBJ(putenv)
42     AC_DEFINE(putenv, rpl_putenv,
43       [Define to rpl_putenv if the replacement function should be used.])
44     gl_PREREQ_PUTENV
45   fi
46 ])
47
48 # Prerequisites of lib/putenv.c.
49 AC_DEFUN([gl_PREREQ_PUTENV], [
50   AC_CHECK_HEADERS_ONCE(unistd.h)
51 ])