This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [trunk][patch] Install headers and plugin-version.o
- From: Ralf Wildenhues <Ralf dot Wildenhues at gmx dot de>
- To: Rafael Espindola <espindola at google dot com>
- Cc: Paolo Bonzini <bonzini at gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 5 May 2009 22:40:39 +0200
- Subject: Re: [trunk][patch] Install headers and plugin-version.o
- References: <38a0d8450904210614v407ef154v17927b6c9bcb0c92@mail.gmail.com> <Pine.LNX.4.64.0904211547271.16159@digraph.polyomino.org.uk> <38a0d8450904210949g3c5d4e9do3042f3047053fcea@mail.gmail.com> <Pine.LNX.4.64.0904211824350.20450@digraph.polyomino.org.uk> <38a0d8450904220509o3d650df1w601198913a3bcafd@mail.gmail.com> <38a0d8450905050624s1de6f10bxe3719c9ffabc1d74@mail.gmail.com> <38a0d8450905050638x7e301d16t5f8113cae7a1172c@mail.gmail.com> <4A0047C8.8090200@gnu.org> <38a0d8450905051020p7b59f9f2r45b564e327f62f3@mail.gmail.com>
* Rafael Espindola wrote on Tue, May 05, 2009 at 07:20:52PM CEST:
> --- a/gcc/Makefile.in
> +++ b/gcc/Makefile.in
> +# Install the headers needed to build a plugin.
> +install-plugin: installdirs
> +# We keep the directory structure for files in config and .def files. All
> +# other files are flattened to a single directory.
> + $(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
> + headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\n' | sort -u`; \
> + for file in $$headers; do \
> + if [ -f $$file ] ; then \
> + path=$$file; \
> + elif [ -f $(srcdir)/$$file ]; then \
> + path=$(srcdir)/$$file; \
> + else continue; \
> + fi; \
> + case $$path in \
> + "$(srcdir)"*/config/* | "$(srcdir)"*.def ) \
Sure you didn't mean this here?
"$(srcdir)"/config/* | "$(srcdir)"/*.def ) \
> + base=`echo $$path | sed "s|$(srcdir)||"`;; \
Ouch. $(srcdir) could contain a backslash, a dot, and other
regex-active characters. Automake uses one of two methods to strip
$(srcdir)/, namely either
srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
or
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \
list=`for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"`
where the second works on lists and doesn't require case matching for
whether a path contains $(srcdir)/ or not.
Cheers,
Ralf