dnl -*- Autoconf -*-
dnl Copyright (C) 1993-2003 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License.  As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
dnl that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.

dnl From Bruno Haible, Marcus Daniels, Sam Steingold.

AC_PREREQ(2.57)

AC_DEFUN([CL_PUTENV],
[dnl Not AC_CHECK_FUNCS(putenv) because it doesn't work when CC=g++.
AC_CACHE_CHECK([for putenv], ac_cv_func_putenv, [
AC_LINK_IFELSE(AC_LANG_PROGRAM(,[putenv("")]),
ac_cv_func_putenv=yes, ac_cv_func_putenv=no)])
if test $ac_cv_func_putenv = yes; then
  AC_DEFINE(HAVE_PUTENV, 1, [Define if you have the putenv() function.])
fi
AC_CHECK_FUNCS(setenv)dnl
AC_CHECK_DECLS(environ,,,[#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif])
])
