The attached patch fixes bootstrap on hppa-hpux and possibly other older
systems without setenv and unsetenv.
The setenv and unsetenvy functions are available in libiberty. All that
is needed is to add declaration configure checks
and the missing declarations when they are not available on the host.
Tested on hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11. Okay for trunk?
Dave
--
John David Anglin dave.ang...@bell.net
2015-09-15 John David Anglin <dang...@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.
Index: configure.ac
===================================================================
--- configure.ac (revision 227558)
+++ configure.ac (working copy)
@@ -1247,7 +1247,7 @@
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"
Index: system.h
===================================================================
--- system.h (revision 227558)
+++ system.h (working copy)
@@ -465,6 +465,10 @@
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 *stpcpy (char *, const char *);
#endif
+#if defined (HAVE_DECL_UNSETENV) && !HAVE_DECL_UNSETENV
+int unsetenv(const char *);
+#endif
+
#ifdef __cplusplus
}
#endif