This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

PATCH: [mingw32] Make GCC work in any directory


Currently, GCC only works on MinGW if installed in particular
places.  Due MinGW's filesystem having a slightly different
layout from most UNIX-like systems, GCC can't automatically
find certain things it needs, even with the MinGW-specific
relative path lookup thing.

Two changes need to be made to let GCC find files no matter
where its installed:

The old STANDARD_INCLUDE_DIR in mingw32.h is not correct,
and I have no idea when it was last correct. (but it wasn't
recently)

GCC also needs to use MD_STARTFILE_PREFIX to help find
some startup files.

Since building GCC for an arbitrary MinGW directory has not
worked recently due to these problems, but presumably once
did, this might be a regression.  It should probably
be applied to 3.3 branch as well as mainline.

I have tested this on current MinGW.

Would someone review this please?

2003-05-22  Aaron W. LaFramboise  <awlaframboise@aol.com>

    * config/i386/mingw32.h (STANDARD_INCLUDE_DIR): Update.
        (MD_STARTFILE_PREFIX): Define.

Index: gcc/gcc/config/i386/mingw32.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/i386/mingw32.h,v
retrieving revision 1.33
diff -c -3 -p -r1.33 mingw32.h
*** gcc/gcc/config/i386/mingw32.h       21 Mar 2003 03:57:09 -0000      1.33
--- gcc/gcc/config/i386/mingw32.h       22 May 2003 22:51:11 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 37,43 ****
  
  /* Specific a different directory for the standard include files.  */
  #undef STANDARD_INCLUDE_DIR
! #define STANDARD_INCLUDE_DIR "/usr/local/mingw32/include"
  #undef STANDARD_INCLUDE_COMPONENT
  #define STANDARD_INCLUDE_COMPONENT "MINGW"
  
--- 37,43 ----
  
  /* Specific a different directory for the standard include files.  */
  #undef STANDARD_INCLUDE_DIR
! #define STANDARD_INCLUDE_DIR "/mingw/include"
  #undef STANDARD_INCLUDE_COMPONENT
  #define STANDARD_INCLUDE_COMPONENT "MINGW"
  
Index: gcc/gcc/config/i386/mingw32.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/i386/mingw32.h,v
retrieving revision 1.33
diff -c -3 -p -r1.33 mingw32.h
*** gcc/gcc/config/i386/mingw32.h       21 Mar 2003 03:57:09 -0000      1.33
--- gcc/gcc/config/i386/mingw32.h       20 May 2003 02:31:08 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 68,73 ****
--- 68,75 ----
  #define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \
    %{!shared:%{!mdll:crt2%O%s}} %{pg:gcrt2%O%s}"
  
+ #define MD_STARTFILE_PREFIX "/mingw/lib/"
+ 
  /* Output STRING, a string representing a filename, to FILE.
     We canonicalize it to be in Unix format (backslashes are replaced
     forward slashes.  */


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