Add definition of GET_ENVIRONMENT and make prefix_from_env() use it.
authorNick Clifton <nickc@cygnus.com>
Tue, 24 Mar 1998 15:55:46 +0000 (15:55 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Tue, 24 Mar 1998 15:55:46 +0000 (15:55 +0000)
From-SVN: r18801

gcc/ChangeLog
gcc/collect2.c

index 6bf7238f44778d8711c10144bf0f8a1090996fa6..4cd64e7bcd87655da01cd3e67ca69b39070f0656 100644 (file)
@@ -7,7 +7,8 @@ Tue Mar 24 10:44:11 1998  Nick Clifton  <nickc@cygnus.com>
        (main): Test for debug command line switch at start of program
        execution. 
        (main): Use GET_ENVIRONMENT rather than getenv().
-       
+       (prefix_from_env): Use GET_ENVIRONMENT.
+
 1998-03-24  Mark Mitchell  <mmitchell@usa.net>
 
        * cplus-dem.c (optable): Add sizeof.
index d974f5d542b37b1a68bc7bf59c426bc93eeeb9ce..1d6bb7545ceb93f5852598de12d9923dba7e2f1a 100644 (file)
@@ -242,9 +242,14 @@ char * temporary_firstobj;
 /* Defined in the automatically-generated underscore.c.  */
 extern int prepends_underscore;
 
+extern char *getenv ();
 extern char *mktemp ();
 extern FILE *fdopen ();
 
+#ifndef GET_ENVIRONMENT
+#define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) ENV_VALUE = getenv (ENV_NAME)
+#endif
+
 /* Structure to hold all the directories in which to search for files to
    execute.  */
 
@@ -906,7 +911,8 @@ prefix_from_env (env, pprefix)
      char *env;
      struct path_prefix *pprefix;
 {
-  char *p = getenv (env);
+  char *p;
+  GET_ENVIRONMENT (p, env);
 
   if (p)
     prefix_from_string (p, pprefix);
@@ -1032,7 +1038,7 @@ main (argc, argv)
      In practice, collect will rarely invoke itself.  This can happen now
      that we are no longer called gld.  A perfect example is when running
      gcc in a build directory that has been installed.  When looking for
-     ld, we will find our installed version and believe that's the real ld.  */
+     ld's, we will find our installed version and believe that's the real ld.  */
 
   /* We must also append COLLECT_NAME to COLLECT_NAMES to watch for the
      previous version of collect (the one that used COLLECT_NAME and only