]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
srcextra fixes
authorJakub Jelinek <jakub@redhat.com>
Fri, 28 Mar 2025 14:45:03 +0000 (15:45 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 28 Mar 2025 14:45:03 +0000 (15:45 +0100)
Here is a patch which uses sed to fix up the copies of the generated
files by flex/bison in the source directories (i.e. what we ship in
release tarballs).
In that case the generated files are in the same directory as the
files they are generated from, so there should be no absolute or relative
directories, just the filenames.

Furthermore, c.srcextra was duplicating the work of gcc.srcextra, there is
nothing C FE specific on gengtype-lex.l.

2025-03-28  Jakub Jelinek  <jakub@redhat.com>

gcc/
* Makefile.in (gcc.srcextra): Use sed to turn .../gcc/gengtype-lex.l
in #line directives into just gengtype-lex.l.
gcc/c/
* Make-lang.in (c.srcextra): Don't depend on anything and don't copy
anything.
gcc/cobol/
* Make-lang.in (cobol.srcextra): Use sed to turn
.../gcc/cobol/*.{y,l,h,cc} and cobol/*.{y,l,h,cc} in #line directives
into just *.{y,l,h,cc}.

gcc/Makefile.in
gcc/c/Make-lang.in
gcc/cobol/Make-lang.in

index ead9c015fb25866515ac87e7421f3479a581ceaf..ebfcd8a8a0d339287c833a83ab7692c069046bc1 100644 (file)
@@ -2508,7 +2508,7 @@ s-mlib: $(srcdir)/genmultilib Makefile
 srcextra: gcc.srcextra lang.srcextra
 
 gcc.srcextra: gengtype-lex.cc
-       -cp -p $^ $(srcdir)
+       -sed -e '/^#line/s,".*/gcc/gengtype-lex\.l","gengtype-lex.l",' $^ > $(srcdir)/$^
 
 AR_OBJS = file-find.o
 AR_LIBS = @COLLECT2_LIBS@
index 049b266dd7107f3d5ca6ea92e4e1bd49bcc3d274..2517b64439fed812ca88fbea7534cf654a3fd2db 100644 (file)
@@ -131,8 +131,7 @@ c.all.cross:
 c.start.encap:
 c.rest.encap:
 c.srcinfo:
-c.srcextra: gengtype-lex.cc
-       -cp -p $^ $(srcdir)
+c.srcextra:
 c.tags: force
        cd $(srcdir)/c; $(ETAGS) -o TAGS.sub *.cc *.h; \
        $(ETAGS) --include TAGS.sub --include ../TAGS.sub
index eb64554f33bc58b001fe86cbc4e1d34e0dec446e..02c867ea22a1e4ae31ff59fc70ebafa01000fcd4 100644 (file)
@@ -272,8 +272,9 @@ cobol/scan.o: cobol/scan.cc                 \
 # output, and do not require those tools to be installed.
 #
 cobol.srcextra: cobol/parse.cc cobol/cdf.cc cobol/scan.cc
-       -cp -p $^ cobol/parse.h cobol/cdf.h $(srcdir)/cobol/
-
+       -for i in $^ cobol/parse.h cobol/cdf.h; do \
+         sed -e '/^#line/s,"\(.*gcc/\)\?cobol/\([^/]*\.\([ylh]\|cc\)\)","\2",' $$i \
+           > $(srcdir)/$$i; done
 
 # And the cobol1 front end