This is the mail archive of the gcc-patches@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: [trunk][patch] Install headers and plugin-version.o


Rafael Espindola wrote:
> Just got a message from Joseph saying he is away from his email. Could
> you please review this patch.

Without a ChangeLog I cannot understand the config.gcc parts.

This:

> +	  if [ "$$path" != "" ]; then \

can use a leftover $$path from the previous iteration; reset it in the
preceding "else", or use "continue".

This:

> +	    config=gcc/config/; \

is wrong when building with srcdir=.

and in general, this:

> +	    echo $$path | grep "$$config" > /dev/null; \
> +	    isconfig=$$?; \
> +	    echo $$path | grep "\.def$$" > /dev/null; \
> +	    isdef=$$?; \
> +	    echo $$path | grep "^$(srcdir)" > /dev/null; \
> +	    is_source=$$?; \
> +	    if [ $$isdef = 0 ] || [ $$isconfig = 0 ]; then \
> +	      if [ $$is_source = 0 ]; then \

may fail depending on set -e, it seems easier to use case and $$file
like this:

case $$path in \
  "$(srcdir)"*/config/* | "$(srcdir)*.def ) base=$$file;; \
  *) base=`basename $$path` ;; \
esac; \
dest=$(plugin_includedir)/$$base; \
dir=`dirname $$dest`; \
$(mkinstalldirs) $$dir; \
$(INSTALL_DATA) $$path $(DESTDIR)/$$dest; \

or something like that; also notice that I used mkinstalldirs instead of

> mkdir -p $$dir

which is exactly what mkinstalldirs replaces, though portably.

Finally, regarding

> +ifeq ($(enable_plugin),yes)
> +INSTALL_PLUGIN=install-plugin
> +else
> +INSTALL_PLUGIN=
> +endif

you can just move it down and say

ifeq ($(enable_plugin),yes)
install: install-plugin
endif

Paolo


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