diff options
author | Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2007-09-03 15:24:48 +0000 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2007-09-03 15:24:48 +0000 |
commit | 47d3331890f360263c044d5d23ff5ef55630a573 (patch) | |
tree | edf1af3d1fd81ce1ee57396d343b84313331fdaa /gcc | |
parent | 7ddb87782d08b109ccf7c137aab6d8b207c87dd9 (diff) | |
download | gcc-47d3331890f360263c044d5d23ff5ef55630a573.zip gcc-47d3331890f360263c044d5d23ff5ef55630a573.tar.gz gcc-47d3331890f360263c044d5d23ff5ef55630a573.tar.bz2 |
gcc.c (xputenv): New function.
* gcc.c (xputenv): New function.
(putenv_from_prefixes): Use xputenv instead of putenv.
(process_command): Use xputenv instead of putenv.
(set_collect_gcc_options): Use xputenv instead of putenv.
(main): Use xputenv instead of putenv.
From-SVN: r128046
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/gcc.c | 21 |
2 files changed, 24 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 09c06fd..563aff0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2007-09-03 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + + * gcc.c (xputenv): New function. + (putenv_from_prefixes): Use xputenv instead of putenv. + (process_command): Use xputenv instead of putenv. + (set_collect_gcc_options): Use xputenv instead of putenv. + (main): Use xputenv instead of putenv. + 2007-09-03 Jesper Nilsson <jesper.nilsson@axis.com> * config/cris/cris.h (TARGET_HAS_SWAP): Defined to describe @@ -297,6 +297,7 @@ static void set_spec (const char *, const char *); static struct compiler *lookup_compiler (const char *, size_t, const char *); static char *build_search_list (const struct path_prefix *, const char *, bool, bool); +static void xputenv (char *); static void putenv_from_prefixes (const struct path_prefix *, const char *, bool); static int access_check (const char *, int); @@ -2598,6 +2599,16 @@ add_to_obstack (char *path, void *data) return NULL; } +/* Add or change the value of an environment variable, outputting the + change to standard error if in verbose mode. */ +static void +xputenv (char *string) +{ + if (verbose_flag) + notice ("%s\n", string); + putenv (string); +} + /* Build a list of search directories from PATHS. PREFIX is a string to prepend to the list. If CHECK_DIR_P is true we ensure the directory exists. @@ -2632,7 +2643,7 @@ static void putenv_from_prefixes (const struct path_prefix *paths, const char *env_var, bool do_multi) { - putenv (build_search_list (paths, env_var, true, do_multi)); + xputenv (build_search_list (paths, env_var, true, do_multi)); } /* Check whether NAME can be accessed in MODE. This is like access, @@ -3413,7 +3424,7 @@ process_command (int argc, const char **argv) standard_bindir_prefix, standard_libexec_prefix); if (gcc_exec_prefix) - putenv (concat ("GCC_EXEC_PREFIX=", gcc_exec_prefix, NULL)); + xputenv (concat ("GCC_EXEC_PREFIX=", gcc_exec_prefix, NULL)); } else { @@ -4332,7 +4343,7 @@ set_collect_gcc_options (void) } } obstack_grow (&collect_obstack, "\0", 1); - putenv (XOBFINISH (&collect_obstack, char *)); + xputenv (XOBFINISH (&collect_obstack, char *)); } /* Process a spec string, accumulating and running commands. */ @@ -6218,11 +6229,11 @@ main (int argc, char **argv) obstack_init (&collect_obstack); obstack_grow (&collect_obstack, "COLLECT_GCC=", sizeof ("COLLECT_GCC=") - 1); obstack_grow (&collect_obstack, argv[0], strlen (argv[0]) + 1); - putenv (XOBFINISH (&collect_obstack, char *)); + xputenv (XOBFINISH (&collect_obstack, char *)); #ifdef INIT_ENVIRONMENT /* Set up any other necessary machine specific environment variables. */ - putenv (INIT_ENVIRONMENT); + xputenv (INIT_ENVIRONMENT); #endif /* Make a table of what switches there are (switches, n_switches). |