This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Problem with $prefix in gcc.c


Hi folks,
In the effort to get GCC  to work with DJGPP without need to maintain 
patches, I
found that setting 
STANDARD_EXEC_PREFIX to "$DJDIR/lib/gcc-lib/" doesn't work very well. (DJDIR 
is
an environment variable that 
contains the directory where a developer has installed DJGPP.) This problem 
is
made worse in the gcc.c in gcc 
2.96 which now uses 'make_relative_prefix' to set GCC_EXEC_PREFIX. This does 
not
work when using prefixes 
starting with '$' . I'm not sure of the best solution, but here is one that 
I'd
like to float:

Index: egcs/gcc/gcc.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gcc.c,v
retrieving revision 1.141
diff -c -4 -p -r1.141 gcc.c
*** gcc.c	2000/05/05 19:03:45	1.141
--- gcc.c	2000/05/05 20:19:57
*************** process_command (argc, argv)
*** 2938,2945 ****
--- 2938,2955 ----
  	  break;
  	}
      }
  
+   /* Resolve paths if they start with a environment variable prefix.  */
+   
+   if (*standard_exec_prefix == '$')
+     standard_exec_prefix = update_path (standard_exec_prefix, "$");
+     
+   if (*standard_bindir_prefix == '$')
+     standard_bindir_prefix = update_path (standard_exec_prefix, "$");
+     
+   if (*tooldir_base_prefix == '$')
+     tooldir_base_prefix = update_path (tooldir_base_prefix, "$");
    /* Set up the default search paths.  If there is no GCC_EXEC_PREFIX,
       see if we can create it from the pathname specified in argv[0].  */
  
  #ifndef VMS



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]