GCC 3.x - patch to fix key look-up order

obry@gnat.com obry@gnat.com
Sun Jun 3 10:29:00 GMT 2001


Hello,

While working on building GNAT on top of GCC 3.1 under Windows using MINGW32
we have face the following issue and we'd like to propose a patch to fix the
problem.

Here is a patch to change the key look-up order. I think that we should first
look at the environment variables and then into the registry. With the current
implementation it is not possibe to use differents compilers on the same
machine by setting GCC_ROOT for example.

<<
*** prefix.c.orig Sat Jun  2 16:13:40 2001
--- prefix.c Sat Jun  2 19:23:46 2001
***************
*** 91,104 ****
    const char *prefix = 0;
    char *temp = 0;
  
  #if defined(_WIN32) && defined(ENABLE_WIN32_REGISTRY)
!   prefix = lookup_key (key);
  #endif
  
    if (prefix == 0)
-     prefix = getenv (temp = concat (key, "_ROOT", NULL));
- 
-   if (prefix == 0)
      prefix = std_prefix;
  
    if (temp)
--- 93,106 ----
    const char *prefix = 0;
    char *temp = 0;
  
+   prefix = getenv (temp = concat (key, "_ROOT", NULL));
+ 
  #if defined(_WIN32) && defined(ENABLE_WIN32_REGISTRY)
!   if (prefix == 0)
!     prefix = lookup_key (key);
  #endif
  
    if (prefix == 0)
      prefix = std_prefix;
  
    if (temp)
>>

Please let me know if you needs more information.

Pascal Obry.
Ada Core Technologies.



More information about the Gcc-patches mailing list