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


>> +	$(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 ) \

This was a literal translation of the original code by Rafael.  Adding a
slash is better.

>> +	    base=`echo $$path | sed "s|$(srcdir)||"`;; \
> 
> Ouch.  $(srcdir) could contain a backslash, a dot, and other
> regex-active characters.

You don't need sed at all, because in this case path is assigned from
$(srcdir)/$$file and all you need is "base=/$file" or "base=$file",
which is what I had proposed in my first review.  Rafael, did you change
it because it didn't work?  What was the problem?

Paolo


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