| 1 | dnl -*-autoconf-*- |
| 2 | |
| 3 | dnl --- *@-mdw_DECL_ENVIRON-@* --- |
| 4 | dnl |
| 5 | dnl Author: Mark Wooding |
| 6 | dnl |
| 7 | dnl Synopsis: mdw_DECL_ENVIRON |
| 8 | dnl |
| 9 | dnl Arguments: --- |
| 10 | dnl |
| 11 | dnl Use: Searches for a declaration of the global `environ' variable. |
| 12 | dnl If one is found in one of the `usual' places, DECL_ENVIRON |
| 13 | dnl is defined as a preprocessor symbol. |
| 14 | |
| 15 | AC_DEFUN([mdw_DECL_ENVIRON], |
| 16 | [AC_CACHE_CHECK([for declaration of \`environ'], mdw_cv_environ, |
| 17 | [AC_EGREP_CPP([\<environ\>], |
| 18 | [#include <sys/types.h> |
| 19 | #if HAVE_UNISTD_H |
| 20 | #include <unistd.h> |
| 21 | #endif |
| 22 | #if STDC_HEADERS |
| 23 | #include <stdlib.h> |
| 24 | #include <stddef.h> |
| 25 | #endif], [mdw_cv_environ=yes], [mdw_cv_environ=no])]) |
| 26 | if test $mdw_cv_environ = yes; then |
| 27 | AC_DEFINE([DECL_ENVIRON], [1], |
| 28 | [Define if you have the `environ' vector of environment variables.]) |
| 29 | fi]) |