This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gtyp-input.list should contain absolute paths.


Hello Basile,

* Basile STARYNKEVITCH wrote on Fri, Jul 03, 2009 at 12:10:17PM CEST:
> It would be much easier for plugins if gtyp-input.list contained
> only absolute paths. In my case, (AMD64/Debian/Sid), it contains
> only two relative filepaths: auto-host.h & options.h

Over here it contains only relative paths.  I build GCC using a relative
srcdir:
  ../gcc/configure

as opposed to
  /path/to/gcc/configure

> If gtyp-input.list contained only absolute path, plugins wanting
> gengtype could use that very list. Otherwise, they have to hack it
> to replace relative file paths (relative to the build directory) by
> absolute ones.

I cannot judge whether using absolute paths in this file is a problem or
not.  The s-gtyp-input rule definitely has problems when the absolute
paths to the files contain whitespace.  (I have no idea whether building
GCC works, or would be nice to work, when source or build directory
names contains whitespace, at least when relative $srcdir is used.)

> I tried to replace in gcc/Makefile.in near line 3437
> s-gtyp-input: Makefile
>    @: $(call write_entries_to_file,$(GTFILES),tmp-gi.list)
>    $(SHELL) $(srcdir)/../move-if-change tmp-gi.list gtyp-input.list
>    $(STAMP) s-gtyp-input
> with
> s-gtyp-input: Makefile
>    @: $(call write_entries_to_file,$(realpath $(GTFILES)),tmp-gi.list)
>    $(SHELL) $(srcdir)/../move-if-change tmp-gi.list gtyp-input.list
>    $(STAMP) s-gtyp-input
> but it does not work.

Please note that "it does not work" is never a good description of any
failure.  You can always do better than that, and be more precise, by
showing the command that failed and any error messages.

> However, I am unfamiliar with GNU make user
> functions and cannot understand how write_entries_to_file work.

Write out names in pieces that don't overflow command line length
limits.  The easiest way to debug such makefile constructs is to use
  make SHELL='/bin/sh -x'

or similar.

One issue with your change is that it drops the [ada] and other language
tags that $(GTFILES) contains.

Hope that helps.

Cheers,
Ralf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]