From: Jim Meyering <meyering@redhat.com>
Date: Sun, 19 Dec 2010 21:48:27 +0000 (+0100)
Subject: setenv: restore to working order
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5555e473be0147419ac6bdfc901ec2284802086;p=pspp

setenv: restore to working order

$HAVE_SETENV is used in gl_FUNC_SETENV, yet its definitions were
mistakenly removed.
* m4/setenv.m4 (gl_FUNC_SETENV_SEPARATE): Restore code to set
HAVE_SETENV.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Restore code to initialize
HAVE_SETENV.
---

diff --git a/ChangeLog b/ChangeLog
index ab8f234ed5..357f06fd02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-12-19  Jim Meyering  <meyering@redhat.com>
+
+	setenv: restore to working order
+	$HAVE_SETENV is used in gl_FUNC_SETENV, yet its definitions were
+	mistakenly removed.
+	* m4/setenv.m4 (gl_FUNC_SETENV_SEPARATE): Restore code to set
+	HAVE_SETENV.
+	* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Restore code to initialize
+	HAVE_SETENV.
+
 2010-12-19  Bruno Haible  <bruno@clisp.org>
 
 	Document some different function declarations on OSF/1 5.1.
diff --git a/m4/setenv.m4 b/m4/setenv.m4
index ccbe267bd7..7070a5d7cf 100644
--- a/m4/setenv.m4
+++ b/m4/setenv.m4
@@ -21,7 +21,9 @@ AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
     HAVE_DECL_SETENV=0
   fi
   AC_CHECK_FUNCS_ONCE([setenv])
-  if test $ac_cv_func_setenv = yes; then
+  if test $ac_cv_func_setenv = no; then
+    HAVE_SETENV=0
+  else
     AC_CACHE_CHECK([whether setenv validates arguments],
       [gl_cv_func_setenv_works],
       [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4
index e5a74cccb8..9ec3e00d1c 100644
--- a/m4/stdlib_h.m4
+++ b/m4/stdlib_h.m4
@@ -92,6 +92,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   HAVE_RANDOM_R=1;           AC_SUBST([HAVE_RANDOM_R])
   HAVE_REALPATH=1;           AC_SUBST([HAVE_REALPATH])
   HAVE_RPMATCH=1;            AC_SUBST([HAVE_RPMATCH])
+  HAVE_SETENV=1;             AC_SUBST([HAVE_SETENV])
   HAVE_DECL_SETENV=1;        AC_SUBST([HAVE_DECL_SETENV])
   HAVE_STRTOD=1;             AC_SUBST([HAVE_STRTOD])
   HAVE_STRTOLL=1;            AC_SUBST([HAVE_STRTOLL])