~ubuntu-branches/debian/squeeze/ffcall/squeeze

« back to all changes in this revision

Viewing changes to src/m4/putenv.m4

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger
  • Date: 2010-06-26 15:29:30 UTC
  • mfrom: (5.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20100626152930-c09y01gk3szcnykn
Tags: 1.10+cvs20100619-2
Ship to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl -*- Autoconf -*-
2
 
dnl Copyright (C) 1993-2005 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 Bruno Haible, Marcus Daniels, Sam Steingold.
10
 
 
11
 
AC_PREREQ(2.57)
12
 
 
13
 
AC_DEFUN([CL_PUTENV],
14
 
[AC_REQUIRE([AC_GNU_SOURCE])
15
 
dnl Not AC_CHECK_FUNCS(putenv) because it doesn't work when CC=g++.
16
 
AC_CACHE_CHECK([for putenv], ac_cv_func_putenv, [
17
 
AC_LINK_IFELSE(AC_LANG_PROGRAM([#include <stdlib.h>], [putenv("")]),
18
 
ac_cv_func_putenv=yes, ac_cv_func_putenv=no)])
19
 
if test $ac_cv_func_putenv = yes; then
20
 
  AC_DEFINE(HAVE_PUTENV, 1, [Define if you have the putenv() function.])
21
 
fi
22
 
AC_CHECK_FUNCS(setenv unsetenv)dnl
23
 
AC_CHECK_DECLS(environ,,,[#include <stdlib.h>
24
 
#ifdef HAVE_UNISTD_H
25
 
#include <unistd.h>
26
 
#endif])
27
 
if test "$ac_cv_func_unsetenv" = yes; then
28
 
  AC_MSG_CHECKING(return value of unsetenv)
29
 
  CL_PROTO_RET([#include <stdlib.h>],[int unsetenv(char*);],[int unsetenv();],
30
 
cl_cv_proto_unsetenv_ret,int,void)
31
 
  AC_MSG_RESULT($cl_cv_proto_unsetenv_ret)
32
 
  if test "$cl_cv_proto_unsetenv_ret" = int;
33
 
  then cl_cv_proto_unsetenv_posix=1
34
 
  else cl_cv_proto_unsetenv_posix=0
35
 
  fi
36
 
  AC_DEFINE_UNQUOTED(UNSETENV_POSIX,$cl_cv_proto_unsetenv_posix,
37
 
  [define to 1 if the return type of unsetenv is int])
38
 
fi
39
 
])