Andris Pavenis wrote:
Included patch is tested only for --build=i686-pc-linux-gnu, --host=i586-mingw32msvc --target=i586-mingw32msvc
Andris
--- gpc-20010924/p/Make-lang.in~1 Mon Sep 24 19:59:48 2001 +++ gpc-20010924/p/Make-lang.in Tue Oct 30 17:57:24 2001 @@ -154,8 +154,12 @@ ADD_RTS_PARENT_DIR = sed -e 's,-B([^/][^:]),-B../../\1,g;s,^([^/][^:]),../../\1,'
# The ' ' is there so, e.g., `-B.' will be replaced by ADD_RTS_PARENT_DIR -RTS_COMPILERS = CC="`echo $(GCC_FOR_TARGET)' ' | $(ADD_RTS_PARENT_DIR)`" \ - PC="`echo $(GPC_FOR_TARGET)' ' | $(ADD_RTS_PARENT_DIR)`" +RTS_COMPILERS = CC="`if test "$(build_canonical)" = "$(host_canonical)" ; then \ + echo $(GCC_FOR_TARGET)' ' | $(ADD_RTS_PARENT_DIR); \
else echo $(GCC_FOR_TARGET); fi`" \
PC="`if test \"$(build_canonical)\" =
"$(host_canonical)" ; then \ + echo $(GPC_FOR_TARGET)' ' | $(ADD_RTS_PARENT_DIR);\
else echo $(GPC_FOR_TARGET); fi`"
GPC_GENERATED_SRC = \ $(srcdir)/p/parse.c \
I don't quite understand what this patch does. AFAICS, it skips $(ADD_RTS_PARENT_DIR) in a cross-build. But $(ADD_RTS_PARENT_DIR) only adds the necessary ../.. to relative paths (since the configure and make of the RTS change to p/rts), and leaves absolute paths unchanged (at least this is what it's supposed to do, unless there's a mistake in the regex).
It skips $(ADD_RTS_PARENT_DIR) for Canadian-cross builds only. In this case we should not try to run newly built compilers as they are intended to be run on host but not the build system.
As I said, $(ADD_RTS_PARENT_DIR) only adds the necessary ../.. for relative paths, so they still work after the chdir. It doesn't affect whether or not the newly bulit compiler is used (i.e., if it's ./xgpc -B./ before $(ADD_RTS_PARENT_DIR), it's ../.././xgpc -B../.././ after, but if it's /usr/bin/foo-gpc before, it will remain so). So I still don't understand what this patch helps there.
So, how should this solve the problem if gpc is `./xgpc -B./'? It would not set GPC_FOR_TARGET to <prefix>/bin/i586-mingw32msvc-gpc, and it would omit the ../../, so it searches for xgpc in the p/rts build directory!?
Since it works for you, I must be missing something ...
I tried to build GPC for MINGW. It seems to work after some hacking. But there seems to be more problems. Do You know somebody messing with building GPC for MINGW earlier? Mailing list archives search didn't work for me, so I'm asking that.
The Chief did (and does) that, and David Bryan is also trying it.
Frank