Replace each use of AC_SUBST(LIBOBJS)/LIBOBJS=... with AC_LIBOBJ([function_name]).
[gnulib.git] / m4 / putenv.m4
1 #serial 4
2
3 dnl From Jim Meyering.
4 dnl
5 dnl Check whether putenv ("FOO") removes FOO from the environment.
6 dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
7 dnl
8
9 AC_DEFUN(jm_FUNC_PUTENV,
10 [AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv,
11   [AC_TRY_RUN([
12     int
13     main ()
14     {
15       /* Put it in env.  */
16       if (putenv ("CONFTEST_putenv=val"))
17         exit (1);
18
19       /* Try to remove it.  */
20       if (putenv ("CONFTEST_putenv"))
21         exit (1);
22
23       /* Make sure it was deleted.  */
24       if (getenv ("CONFTEST_putenv") != 0)
25         exit (1);
26
27       exit (0);
28     }
29               ],
30              jm_cv_func_svid_putenv=yes,
31              jm_cv_func_svid_putenv=no,
32              dnl When crosscompiling, assume putenv is broken.
33              jm_cv_func_svid_putenv=no)
34   ])
35   if test $jm_cv_func_svid_putenv = no; then
36     AC_LIBOBJ([putenv])
37     AC_DEFINE_UNQUOTED(putenv, rpl_putenv,
38       [Define to rpl_putenv if the replacement function should be used.])
39   fi
40 ])