This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: [mingw32] Make GCC work in any directory
- From: AWLaFramboise at aol dot com
- To: dannysmith at users dot sourceforge dot net (Danny Smith), gcc-patches at gcc dot gnu dot org
- Date: Thu, 22 May 2003 21:57:56 -0400
- Subject: Re: PATCH: [mingw32] Make GCC work in any directory
In a message dated 5/22/2003 7:43:38 PM Eastern Standard Time, dannysmith@clear.net.nz writes:
> AWLaFramboise wrote:
> > 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.
> >
> No that still doesn't do the right thing for relocateable installation
> What happens if you want to move the installation to D:/anypath?
>
> This does. It only affects native host.
>
> Bootstrapped on 3.3, trunk. After installation I move the tree to
> C:\Program Files\GNU\test-gcc and it still could find everything, even
> when started from another drive.
>
> It is also the way binaries distributed by mingw.org are built and it
> seems to work for most users (since at least Jan 1999).
I might just be screwing up, but I don't think your patch
works.
Applying against release 3.3,
../gcc-3.3/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --
target=mingw32 --prefix=/usr/local/share/gcc/gcc-3.3 --enable-threads --disable
-nls --enable-languages=c++,f77,objc --disable-win32-registry --disable-shared
--enable-sjlj-exceptions
DOES NOT work.
Nothing out of the ordinary that appeared to be related to
this patch was reported during configure, but when i attempted
bootstrap with "make bootstrap",
I got this error when it started to build libgcc for stage2,
after apparently successfully building stage1.
mkdir libgcc
if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi
./xgcc -B./ -B/usr/local/share/gcc/gcc-3.3/mingw32/bin/ -isystem /usr/local/share/gcc/gcc-3.3/mingw32/include -isystem /usr/local/share/gcc/gcc-3.3/mingw32/sys-include -O2 -I../../gcc-3.3/gcc/../winsup/include -I../../gcc-3.3/gcc/../winsup/cygwin/include -I../../gcc-3.3/gcc/../winsup/w32api/include -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../gcc-3.3/gcc -I../../gcc-3.3/gcc/. -I../../gcc-3.3/gcc/config -I../../gcc-3.3/gcc/../include -DL_chkstk -xassembler-with-cpp -c ../../gcc-3.3/gcc/config/i386/cygwin.asm -o libgcc/./_chkstk.o
./xgcc -B./ -B/usr/local/share/gcc/gcc-3.3/mingw32/bin/ -isystem /usr/local/share/gcc/gcc-3.3/mingw32/include -isystem /usr/local/share/gcc/gcc-3.3/mingw32/sys-include -O2 -I../../gcc-3.3/gcc/../winsup/include -I../../gcc-3.3/gcc/../winsup/cygwin/include -I../../gcc-3.3/gcc/../winsup/w32api/include -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../gcc-3.3/gcc -I../../gcc-3.3/gcc/. -I../../gcc-3.3/gcc/config -I../../gcc-3.3/gcc/../include -DL_muldi3 -c ../../gcc-3.3/gcc/libgcc2.c -o libgcc/./_muldi3.o
In file included from ../../gcc-3.3/gcc/config/i386/mingw32.h:32,
from tconfig.h:17,
from ../../gcc-3.3/gcc/libgcc2.c:36:
../../gcc-3.3/gcc/config/i386/cygwin.h:30:19: stdio.h: No such file or directory
In file included from ../../gcc-3.3/gcc/config/i386/mingw32.h:32,
from tconfig.h:17,
from ../../gcc-3.3/gcc/libgcc2.c:36:
../../gcc-3.3/gcc/config/i386/cygwin.h:415: error: parse error before '*' token
../../gcc-3.3/gcc/config/i386/cygwin.h:415: warning: function declaration isn't a prototype
../../gcc-3.3/gcc/config/i386/cygwin.h:417: error: parse error before '*' token
../../gcc-3.3/gcc/config/i386/cygwin.h:417: warning: function declaration isn't a prototype
In file included from ../../gcc-3.3/gcc/libgcc2.c:37:
../../gcc-3.3/gcc/tsystem.h:72:19: stdio.h: No such file or directory
../../gcc-3.3/gcc/tsystem.h:75:23: sys/types.h: No such file or directory
../../gcc-3.3/gcc/tsystem.h:78:19: errno.h: No such file or directory
../../gcc-3.3/gcc/tsystem.h:85:20: string.h: No such file or directory
../../gcc-3.3/gcc/tsystem.h:89:20: stdlib.h: No such file or directory
../../gcc-3.3/gcc/tsystem.h:90:20: unistd.h: No such file or directory
In file included from include/limits.h:122,
from include/syslimits.h:7,
from include/limits.h:11,
from ../../gcc-3.3/gcc/tsystem.h:93,
from ../../gcc-3.3/gcc/libgcc2.c:37:
include/limits.h:122:75: no include path in which to find limits.h
In file included from ../../gcc-3.3/gcc/libgcc2.c:37:
../../gcc-3.3/gcc/tsystem.h:96:18: time.h: No such file or directory
make[3]: *** [libgcc/./_muldi3.o] Error 1
make[3]: Leaving directory `/c/aaronwl/cs/src/mingw/contrib/gcc/try2/objdir/gcc'
make[2]: *** [libgcc.a] Error 2
make[2]: Leaving directory `/c/aaronwl/cs/src/mingw/contrib/gcc/try2/objdir/gcc'
make[1]: *** [stage1_build] Error 2
make[1]: Leaving directory `/c/aaronwl/cs/src/mingw/contrib/gcc/try2/objdir/gcc'
make: *** [bootstrap] Error 2
"c:/msys/1.0/usr/local/share/gcc/gcc-3.3" also does
not work.
Am I doing something wrong??
Outside of this, perhaps it is a good idea to at least have
STANDARD_INCLUDE_DIR set correctly anyway? It seems like
this could minimize suprises, and it seems like a valid
setting would be better than something that is afaik completely
bogus now.
Puzzled,
Aaron