Problems building GPC when host!=build

Andris Pavenis pavenis at latnet.lv
Tue Oct 30 17:18:19 CET 2001


Configuring in p/rts fails when host!=build (for example when building
native compiler for DJGPP or MINGW under Linux) as newly built
xgcc and xgpc cannot be run on build system. In this case we should
run corresponding cross-compiler instead.

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 \




More information about the Gpc mailing list