From 5b6507b0981189ee84e17c6e2d9b79ea59c2a5b0 Mon Sep 17 00:00:00 2001 From: danglin Date: Thu, 10 Sep 2015 22:52:08 +0000 Subject: PR bootstrap/67363 * configure.ac: Check if setenv and unsetenv are declared. * configure: Rebuild. * config.in: Rebuild. * system.h: Declare setenv and unsetenv if not declared. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227666 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 8 ++++++++ gcc/config.in | 14 ++++++++++++++ gcc/configure | 2 +- gcc/configure.ac | 2 +- gcc/system.h | 8 ++++++++ 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7f15326d40a..44e84a4a5f1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2015-09-15 John David Anglin + + PR bootstrap/67363 + * configure.ac: Check if setenv and unsetenv are declared. + * configure: Rebuild. + * config.in: Rebuild. + * system.h: Declare setenv and unsetenv if not declared. + 2015-09-10 Bill Schmidt * config/rs6000/rs6000.c (swap_web_entry): Update preceding diff --git a/gcc/config.in b/gcc/config.in index 98c46478a14..431d26218d1 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -934,6 +934,13 @@ #endif +/* Define to 1 if we found a declaration for 'setenv', otherwise define to 0. + */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_SETENV +#endif + + /* Define to 1 if we found a declaration for 'setrlimit', otherwise define to 0. */ #ifndef USED_FOR_TARGET @@ -1025,6 +1032,13 @@ #endif +/* Define to 1 if we found a declaration for 'unsetenv', otherwise define to + 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_UNSETENV +#endif + + /* Define to 1 if we found a declaration for 'vasprintf', otherwise define to 0. */ #ifndef USED_FOR_TARGET diff --git a/gcc/configure b/gcc/configure index 07d39f94393..846c996342f 100755 --- a/gcc/configure +++ b/gcc/configure @@ -10926,7 +10926,7 @@ _ACEOF for ac_func in getenv atol atoll asprintf sbrk abort atof getcwd getwd \ madvise stpcpy strnlen strsignal strverscmp \ - strtol strtoul strtoll strtoull \ + strtol strtoul strtoll strtoull setenv unsetenv \ errno snprintf vsnprintf vasprintf malloc realloc calloc \ free getopt clock getpagesize ffs clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked do diff --git a/gcc/configure.ac b/gcc/configure.ac index b6e8bed843f..34c43d54228 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1247,7 +1247,7 @@ AC_CHECK_DECLS([basename(const char*), strstr(const char*,const char*)], , ,[ gcc_AC_CHECK_DECLS(getenv atol atoll asprintf sbrk abort atof getcwd getwd \ madvise stpcpy strnlen strsignal strverscmp \ - strtol strtoul strtoll strtoull \ + strtol strtoul strtoll strtoull setenv unsetenv \ errno snprintf vsnprintf vasprintf malloc realloc calloc \ free getopt clock getpagesize ffs gcc_UNLOCKED_FUNCS, , ,[ #include "ansidecl.h" diff --git a/gcc/system.h b/gcc/system.h index 78ad60904dc..1cc5d408df0 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -465,6 +465,10 @@ extern char *getwd (char *); extern void *sbrk (int); #endif +#if defined (HAVE_DECL_SETENV) && !HAVE_DECL_SETENV +int setenv(const char *, const char *, int); +#endif + #if defined (HAVE_DECL_STRSTR) && !HAVE_DECL_STRSTR extern char *strstr (const char *, const char *); #endif @@ -473,6 +477,10 @@ extern char *strstr (const char *, const char *); extern char *stpcpy (char *, const char *); #endif +#if defined (HAVE_DECL_UNSETENV) && !HAVE_DECL_UNSETENV +int unsetenv(const char *); +#endif + #ifdef __cplusplus } #endif -- cgit v1.2.1