diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2012-02-19 16:09:08 +0100 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2012-02-19 16:52:38 +0100 |
commit | bc66878bdea0250991fc99b2d023146f67a6f4bb (patch) | |
tree | 7a7de4be51541756d8b6333d48eb450ef6c036d2 /configure.in | |
parent | 3a94530595cfb57bdb4e3401d29a8a4d0b638d01 (diff) | |
download | tor-bc66878bdea0250991fc99b2d023146f67a6f4bb.tar.gz tor-bc66878bdea0250991fc99b2d023146f67a6f4bb.zip |
Don't redeclare environ if std headers already did
This would cause a redundant redeclaration warning on some versions of
Linux otherwise.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/configure.in b/configure.in index 7b6d8fb023..7415ce8312 100644 --- a/configure.in +++ b/configure.in @@ -1086,6 +1086,17 @@ int main(int c, char **v) { puts(__FUNCTION__); }])], tor_cv_have_FUNCTION_macro=yes, tor_cv_have_FUNCTION_macro=no)) +AC_CACHE_CHECK([whether we have extern char **environ already declared], + tor_cv_have_environ_declared, + AC_COMPILE_IFELSE([AC_LANG_SOURCE([ +/* We define _GNU_SOURCE here because it is also defined in compat.c. + * Without it environ doesn't get declared. */ +#define _GNU_SOURCE +#include <unistd.h> +int main(int c, char **v) { char **t = environ; }])], + tor_cv_have_environ_declared=yes, + tor_cv_have_environ_declared=no)) + if test "$tor_cv_have_func_macro" = 'yes'; then AC_DEFINE(HAVE_MACRO__func__, 1, [Defined if the compiler supports __func__]) fi @@ -1099,6 +1110,11 @@ if test "$tor_cv_have_FUNCTION_macro" = 'yes'; then [Defined if the compiler supports __FUNCTION__]) fi +if test "$tor_cv_have_environ_declared" = 'yes'; then + AC_DEFINE(HAVE_EXTERN_ENVIRON_DECLARED__, 1, + [Defined if we have extern char **environ already declared]) +fi + # $prefix stores the value of the --prefix command line option, or # NONE if the option wasn't set. In the case that it wasn't set, make # it be the default, so that we can use it to expand directories now. |