public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] PR bootstrap/67363: Fix setenv/unsetenv declaration issue in gcc.c
@ 2015-09-10 20:12 John David Anglin
  2015-09-10 20:53 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: John David Anglin @ 2015-09-10 20:12 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 432 bytes --]

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.anglin@bell.net


[-- Attachment #2: setenv.d.txt --]
[-- Type: text/plain, Size: 1448 bytes --]

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.

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] PR bootstrap/67363: Fix setenv/unsetenv declaration issue in gcc.c
  2015-09-10 20:12 [PATCH] PR bootstrap/67363: Fix setenv/unsetenv declaration issue in gcc.c John David Anglin
@ 2015-09-10 20:53 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2015-09-10 20:53 UTC (permalink / raw)
  To: John David Anglin, GCC Patches

On 09/10/2015 02:11 PM, John David Anglin wrote:
> 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.anglin@bell.net
>
>
> setenv.d.txt
>
>
> 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.
OK.
jeff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-10 20:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-10 20:12 [PATCH] PR bootstrap/67363: Fix setenv/unsetenv declaration issue in gcc.c John David Anglin
2015-09-10 20:53 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).