summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-10 22:52:08 +0000
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-10 22:52:08 +0000
commit5b6507b0981189ee84e17c6e2d9b79ea59c2a5b0 (patch)
treef69f089eefa4131dd05bc665bb157ac833fdabe1
parent8dcdfb3892ca09812246fea50ae56c2be2fbc154 (diff)
downloadgcc-5b6507b0981189ee84e17c6e2d9b79ea59c2a5b0.tar.gz
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
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config.in14
-rwxr-xr-xgcc/configure2
-rw-r--r--gcc/configure.ac2
-rw-r--r--gcc/system.h8
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 <danglin@gcc.gnu.org>
+
+ 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 <wschmidt@linux.vnet.ibm.com>
* 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