From: John David Anglin Date: Thu, 10 Sep 2015 22:52:08 +0000 (+0000) Subject: re PR bootstrap/67363 (r227188 breaks build for mingw-w64) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=297c364d7ce9ba632aa1a54d8e3ac7df11deac12;p=gcc.git re PR bootstrap/67363 (r227188 breaks build for mingw-w64) 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. From-SVN: r227666 --- 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