Patchwork installing properly gengtype

login
register
mail settings
Submitter Basile Starynkevitch
Date June 28, 2011, 3:43 p.m.
Message ID <20110628174340.ce9cf85e.basile@starynkevitch.net>
Download mbox | patch
Permalink /patch/102414/
State New
Headers show

Comments

Basile Starynkevitch - June 28, 2011, 3:43 p.m.
Hello All,

gengtype becomes a user-level program, like cc1 is, so should be installed at the same place as cc1.

For reasons I don't understand, I was told that gengtype needs to be compiled twice (both as build & as host, IIRC).

The patch below does not even work, but I would like some advice about it.


#################

How do you think gengtype should be built & installed as a user program?

I am very uneasy with gcc/Makefile.in, so I really need help about this.

Cheers.

Patch

Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 175588)
+++ gcc/Makefile.in	(working copy)
@@ -769,7 +769,7 @@ 
 OTHER_FIXINCLUDES_DIRS=
 
 # A list of all the language-specific executables.
-COMPILERS = cc1$(exeext) @all_compilers@
+COMPILERS = cc1$(exeext) gcc-gengtype$(exeext) @all_compilers@
 
 # List of things which should already be built whenever we try to use xgcc
 # to compile anything (without linking).
@@ -1529,7 +1529,7 @@ 
  tm-preds.h tm-constrs.h checksum-options \
  tree-check.h min-insn-modes.c insn-modes.c insn-modes.h \
  genrtl.h gt-*.h gtype-*.h gtype-desc.c gtyp-input.list \
- xgcc$(exeext) cpp$(exeext) cc1$(exeext) $(EXTRA_PASSES) \
+ xgcc$(exeext) cpp$(exeext) cc1$(exeext) gcc-gengtype$(exeext) $(EXTRA_PASSES) \
  $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
  $(SPECS) collect2$(exeext) lto-wrapper$(exeext) \
  gcov-iov$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \
@@ -1827,7 +1827,7 @@ 
 	$(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(COLLECT2) lto-wrapper$(exeext)
 
 # Define the names for selecting languages in LANGUAGES.
-c: cc1$(exeext)
+c: cc1$(exeext) gcc-gengtype$(exeext)
 
 # Tell GNU make these are phony targets.
 .PHONY: c
@@ -4047,6 +4047,11 @@ 
 build/gengtype$(build_exeext) : build/gengtype-lex.o build/gengtype-parse.o \
               build/gengtype-state.o build/version.o
 
+# The gengtype to be installed
+gcc-gengtype$(exeext): gengtype-lex.o gengtype-parse.o \
+              gengtype-state.o version.o $(LIBIBERTY)
+	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $^
+
 # Rule for the generator programs:
 $(genprog:%=build/gen%$(build_exeext)): build/gen%$(build_exeext): build/gen%.o $(BUILD_LIBDEPS)
 	+$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) -o $@ \